Search code examples
phplaravel-5laravel-artisanbluehost

PHP artisan command returns nothing


I just moved my Laravel application to production server. I am trying to execute artisan command via PuTTy which ends with

[Error Exception] Invalid argument supplied for foreach()

What I've tried

Reading about the topic, forum suggested few things

1) Setting file permission for storage directory to 0755

2) Tried executing artisan command using php-cli. At bluehost I can access php-cli at /ramdisk/php/54/bin/php54-cli

Command

/ramdisk/php/54/bin/php54-cli artisan list

Result

Commands ends up showing nothing.

Any pointers towards issue are highly appreciated.


Solution

  • Laravel 5.2 is not compatible with PHP 5.4, it seems you are using it. You may consider to update your PHP version to PHP >= 5.5.9 (or, worst solution, downgrade Laravel). It can not work with this version.

    Anyway, if you want to understand error, you could have a look at your logs (in storage/logs/), but maybe it's empty, due to the incompatibility mentioned above.

    EDIT

    php-cli version must also be >=5.5.9 if you are using laravel 5.2. Make sure you point out to the right php file