After copying Laravel from one PC to another it shows a strange error from helpers.php
When I copied the laravel folder from one PC to another and tried to run it, it shows the following error:
Parse error: syntax error, unexpected '[' in C:\xampp\htdocs\accounts\vendor\laravel\framework\src\Illuminate\Foundation\helpers.php on line 383
The same file is working well in the source PC, but in the destination PC it is not.
I have googled it, but no help.
So I tried to make it online. Even though I have changed the name of the database in database.php
file in the production server it takes the old database only.
Can anyone help me resolve this?
Answer
On other PC you have PHP < 5.4.
http://php.net/manual/en/language.types.array.php
As of PHP 5.4 you can also use the short array syntax, which replaces array() with [].
So, most probably, on line 383 you have an array with new []
syntax.
Solution is to upgrade PHP, PHP 5.3 is not supported anymore: http://php.net/supported-versions.php
Related Questions
- → "failed to open stream" error when executing "migrate:make"
- → October CMS Plugin Routes.php not registering
- → OctoberCMS Migrate Table
- → OctoberCMS Rain User plugin not working or redirecting
- → October CMS Custom Mail Layout
- → October CMS - How to correctly route
- → October CMS create a multi select Form field
- → October CMS - Conditionally Load a Different Page
- → How to disable assets combining on development in OctoberCMS
- → October CMS - Radio Button Ajax Click Twice in a Row Causes Content to disappear
- → OctoberCms component: How to display all ID(items) instead of sorting only one ID?
- → In OctoberCMS how do you find the hint path?
- → How to register middlewares in OctoberCMS plugin?