I am having problems executing cron jobs in my project..
i have a queue, if i simples go to the terminal and execute queue:work it will process, however if i try using the console command through cron job like this:
i get the following error outputted to my log file
local.ERROR: exception 'PDOException' with message 'SQLSTATE[HY000] [2002] No such file or directory' in /Users/me/laravel_project/vendor/laravel/framework/src/Illuminate/Database/Connectors/Connector.php:50
and the crontab is set correctly as if i append a custom command just to log::info("hi"); it works
This what I do to make it work. This is from an email I sent, it references Laravel 4, but all applies.
Hi,
I had to put the path in my cron file. Once done done, all works fine. MAC OSX, Laravel 4, PHP 5.6.3
Here is my file:
SHELL=/bin/bash
PATH=/Applications/:/Applications/XAMPP/xamppfiles/bin/:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin
* * * * * php /Users/jimm/WebProjects/laravel42/artisan scheduled:run 1>> /dev/null 2>&1
Oh Thanks man @jimmck after seeing your answerer i figure out what was wrong.. it`s indeed the path... you just need to specify the path where your php lies, i guess by using just the PHP it will point to the old version which ships on the OS..