Recently while using Laravel I ran into a problem running my artisan tasks on a shard hosting platform like Bluehost and there many others. There was an issue filed on the Laravel Github Issues Tracker so I had ran into a dead end. Google searches came up empty. After some investigating I found the solution.
So here is the error that started the whole issue.
1 2 3 4
And there were many other weird erros arising. So after looking around I found another CLI PHP issue that someone had on a shared host from like 2009. At this point I figured I would give it a try.
On these shard hosts they have two version of PHP install. There is a command line version and a regular version. However, that regular version doesn’t work with artisan in laravel.
If you run
which php you end up with
/usr/php/53/usr/bin/php however, this doesn’t work. What they don’t exactly publish is there is another version
/usr/php/53/usr/bin/php-cli. This version will work with Laravel.
So you can use
/usr/php/53/usr/bin/php-cli artisan migrate:install.
Long winded answer for something so simple and core to Laravel which is what makes Laravel so awesome.