(01-19-2018, 12:38 PM)Narf Wrote: (01-18-2018, 07:45 AM)creawbe Wrote: Code:
*/30 * * * * /usr/bin/php /var/www/index.php cli/cron checkVacanciesStatusses >/dev/null 2>&1
The syntax after index.php should be the same as if you enter it in a URL. I don't know what 'cli/cron' is in there, maybe dir/controller, but the fact that the checkVacanciesStatusses is separated from them doesn't look right.
(01-19-2018, 02:35 AM)creawbe Wrote: (01-18-2018, 01:14 PM)skunkbad Wrote: Of course there are no errors, because you are suppressing them:
Remove that and try again.
Hello Skunkbad!
I tried removing that, there are no errors, the only thing it returns is warnings about the time usage, that's all. If i execute thiswithout the IF cli check, the logging does happen. So I know the code is working as intended.
This can't be true if only the logging doesn't work - either the entire thing doesn't work under CLI, or you have more errors. You've used $_SERVER['REQUEST_URI'] in there, and that variable doesn't exist under a CLI environment, so there must be a warning about that.
This was the issue!
I did not manage to trigger the error, but removing the $_SERVER is what did it. If i think of it, it's logical it's not available there. Thank you very much!