I have come to realize that how you write the cron for the laravel scheduler varies from hosting to hosting so the docs are useless in this case.
The same code I used on my previous host(siteground) does not seem to be working on my current one(inmotion).
The cron that runs the scheduler, the one I set from my CPanel seems to work:
php -q /home/xxxxx/xxxxx/artisan schedule:run
I say it seems to work because I get this email whenever my cron runs:
Running scheduled command: /usr/bin/php -q /home/xxxxx/xxxxx/artisan {command} > '/dev/null' 2>&1 &
Now the above script does not seem to execute it just hangs and the processes pile up eating my memory until my entire server crashes.
So I'm quite confused here, why does php -q /home/xxxxx/xxxxx/artisan schedule:run
execute but somehow my app is unable to execute /usr/bin/php -q /home/xxxxx/xxxxx/artisan {command}
I googled it and several suggestions where to use php-cli
instead of php -q
but php-cli gives me a command not found
error.
So I asked support about this and this is what they said:
I am not certain how you were able to run that command with another host, as php-cli is not a command for the php command line interface. Unfortunately, because this is not a valid command, I am not sure if I understand what you are trying to accomplish by running it.
php -q is the option that executes php-cli, which is what you should be using for your crons; however it will only properly execute if the coding of the file that you are executing is correct.
I have been on this for 2 days now, my question is how do I get my laravel scheduler to execute without any errors, does anyone have any experience with deploying a laravel(lumen) application on inmotion servers or similar? Thanks in advance. :)