Laravel 4: copy from local to live server - php

I am trying to copy a project from localhost to live server done in Laravel 4 framework.
On the local machine it is working, but I have this error in live server:
Warning: Unexpected character in input: '\' (ASCII=92) state=1 in
/**********/laravel/bootstrap/autoload.php on line 46
Parse error: syntax error, unexpected T_STRING in
/**********/laravel/bootstrap/autoload.php on line 46
I didn't modify those files.
Thanks

At line 46 there is
Patchwork\Utf8\Bootup::initAll();
and php complaining for \ which means it doesn't supprt namespace, you have to upgrade to PHP 5 >= 5.3.0 because right now it's (on your live server) prior to PHP 5.3.0 and remember that laravel requires PHP >= 5.3.7 so upgrade your php version.

Related

Laravel 7: Installing od FTP Server

I installed Laravel 7 on my FTP server, but I get this message
Parse error: syntax error, unexpected ':', expecting '{' in /vendor/symfony/polyfill-php80/bootstrap.php on line 23
When I used localhost everything was fine. What is wrong?
Laravel 7 require PHP >= 7.2.5. Check version installed on server.

Parse error: syntax error, unexpected '?' in /vendor/laravel/framework/src/Illuminate/Foundation/helpers.php on line 233 - laravel

I have a subdomain folder running on php 7. Globally my php version is 5.6 actually. When i run my project, i get a 500 internal error. Checking my error_log, i see this error
Fatal error: Call to undefined function Symfony\Polyfill\Mbstring\iconv_strpos() in /home/invoice/vendor/symfony/polyfill-mbstring/Mbstring.php on line 358
I tried to install this command composer require symfony/polyfill-icon in my subfolder (under the subdomain which is running on php 7) but then this is the result in the terminal
Warning: Ambiguous class resolution, "App\Http\Controllers\Auth\RegisterController" was found in both "/home/laravel/public_html/myproject/app/Http/Controllers/mNotify/Auth/RegisterController.php" and "/home/laravel/public_html/myproject/app/Http/Controllers/Auth/RegisterController.php", the first will be used.
> Illuminate\Foundation\ComposerScripts::postAutoloadDump
Parse error: syntax error, unexpected '?' in /home/laravel/public_html/myproject/vendor/laravel/framework/src/Illuminate/Foundation/helpers.php on line 233
When i look in the vendor file in my subfolder under the subdomain, the
Symfony\Polyfill\Mbstring\iconv is installed there but when i test from the terminal using php --ir iconv, it get Extension iconv is not present.
What is happening?
check if mod php < 7.0 has enabled to disabled it.
and enable mod php 7 or 7.1

Laravel 5 error.

I just uploaded my L5 project to host server. And this is the error that I'm getting.
Parse error: syntax error, unexpected T_CLASS, expecting T_STRING or T_VARIABLE or '$' on line 50 this line is in index.php
This is the 50 line
$kernel = $app->make(Illuminate\Contracts\Http\Kernel::class);
Can I somehow change this line or make my project to php 5.5.32 version ? Because L5 framework using 5.6.25 and that sucks a little bit.
$kernel = $app->make(Illuminate\Contracts\Http\Kernel::class);//This is line 50
the ::class is only supported since PHP 5.5
Ref:Laravel 4 inside Wamp does not work
Requirement:
http://laravel.com/docs/5.1/releases#laravel-5.1.4

Chamilo ERROR : Warning: Unexpected character in input: '\' (ASCII=92) state=1 in /srv/disk8/1265300/www/portal.mdg-5.org/index.php on line 9

I have the following error with my Chamilo
Warning: Unexpected character in input: '\' (ASCII=92) state=1 in
/srv/disk8/1265300/www/portal.mdg-5.org/index.php on line 9
Parse error: syntax error, unexpected T_STRING, expecting
T_CONSTANT_ENCAPSED_STRING or '(' in
/srv/disk8/1265300/www/portal.mdg-5.org/index.php on line 9
On line 9 is the following code:
use \ChamiloSession as Session;
I'm using PHP 5.2.17.
This happens because the code you are using is attempting to use PHP namespaces. Namespaces were only introduced in PHP 5.3 and will not work on your system.
PHP >5.3 is specified as a requirement on the Chamilo website.
Unfortunately, there is essentially nothing you can do short of upgrading your version of PHP. If you are on shared hosting, this will of course be rather difficult.

Parse error: syntax error, unexpected T_STRING in .... on line 192

I have this error:
Parse error: syntax error, unexpected T_STRING in
/home/u1/public_html/scripts/easypanel.php on line 192
When i run that on the local it's work, but on the real server it's not:
line 192 is:
if(isset($_POST['send_pass']))
{
if($_POST['post_password'] == $password)
{
goto content;# = line 192
}
else
{
echo '<div class="box error">password incorrect</div><br>';
}
}
...
content:
echo $content;
What's the problem?
The goto operator is available as of PHP 5.3.
Please check the version of your php on the local.
you can type php -v in the terminal to see the version.
You said your server version is 5.2. Thats what creating the problem. "goto" was introduced in 5.3. So you can either ask for an upgrade of the server version or stop using goto altogether because 5.2 does not support it. It works fine on local because on local you are using PHP version 5.3

Categories