PHP-cli error
Hello. We try to run a cron job:
php /home/xxxxxxxxxx/public_html/scripts/exploit/cron_run_alljobs.php >> /home/xxxxxxxxxxxx/public_html/documents/cron/cronjobs.log
but in return we have this error:
Error: You are using PHP for CGI. To execute cron_run_alljobs.php from command line, you must use PHP for CLI mode.
I e-retailer and not specialist. Yet it seems that php-cli is installed.
Thank you for your ideas and aids
-
Hi, Instead of calling 'php' via the cron', instead call '/usr/local/bin/php'. This is the CLI variant. I hope this helps! 0 -
Thanks Jacob cP. I convey our developer. Hope it will help 0 -
One thing, if we run this command from the command line via SSH it works perfectly. But not automatic task. In automatic Error: You are using PHP for CGI. To execute cron_run_alljobs.php from command line, you must use PHP for CLI mode. 0 -
Hello @canou83, Updating the PHP command for this cron job to "/usr/local/bin/php" should address the issue. You may also find the following document helpful: EasyApache 4 and the ea-php-cli Package - EasyApache 4 - cPanel Documentation Thank you. 0 -
Work fine. Thanks all. 0
Please sign in to leave a comment.
Comments
5 comments