简体   繁体   中英

Laravel 4.2 support for PHP 5.3 on shared hosting

My hosting service provider has PHP 5.2 in it. When i hosted my laravel 4.2 application i got 2 errors

1. NameSpace error: Warning: Unexpected character in input: '\' (ASCII=92) state=1 in
2. Short way of array defining error: []

First problem was solved because i asked them to upgrade the php to 5.3. Now to solve the second problem i need them to upgrade php for 5.4 which is not possible because the max php version they have is 5.3

What is the solution to solve this problem on PHP 5.3 platform using Laravel 4.2

The options are quite easy to solve this.

  1. Get a new host. PHP 5.3 is extremely outdated. There is rarely a reason now not to move to a new host who offers at least PHP 5.5. You can use Laravel Forge and setup a new server on Digital Ocean or Linode for as little as $5 per month.

  2. Use Laravel 4.1 which is designed for PHP >= 5.3.7

You will not be able to get 4.2 to work on PHP 5.3 due to the use of traits and short array syntax.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM