Messages like:
Warning: Unexpected character in input: '\' (ASCII=92) state=1
And:
Parse error: syntax error, unexpected T_STRING
Indicate two possibilities, either you edited something you shouldn’t and broke the script, or you’re using older version of PHP that doesn’t support Laravel.
By message Unexpected character in input: '\'
you must be using PHP 5.2, because namespaces only work after 5.3
But it is important to know that the use of ::class
, that this in line 52 of index.php does not work in neither PHP 5.3:
$kernel = $app->make(Illuminate\Contracts\Http\Kernel::class);
To make sure the version create a file called info.php
in public_html
and add this:
<?php
echo 'Versão Atual do PHP: ' . phpversion();
It will display the details of your PHP version, so you will be sure if it is 7.1, if it is in fact 7.1 then it means that either you damaged index.php or it failed to upload.
If the version is correct and index.php is like this:
<?php
define('LARAVEL_START', microtime(true));
require __DIR__.'/../vendor/autoload.php';
$app = require_once __DIR__.'/../bootstrap/app.php';
$kernel = $app->make(Illuminate\Contracts\Http\Kernel::class);
$response = $kernel->handle(
$request = Illuminate\Http\Request::capture()
);
$response->send();
$kernel->terminate($request, $response);
Then the problem is in the upload, if you are using Filezilla, maybe your FTP is breaking something while trying to climb as ASCII, so that it does not lose data upload as binary, for example in Filezilla go to:
Transfer > Transfer type > and change Auto for Binary
As in the image:
Then upload it again.
What version of Laravel and what version of PHP is in your Ocaweb?
– Guilherme Nascimento
@Guilhermenascimento php is running the 7.1 is the Laravel is in the latest version 5.4
– Robson Rodrigues