CLI not recognized in cron jobs
I cant seem to get CLI to get recognized during my cron jobs. I can get it to return just fine when I run the script from the terminal. Im using php_sapi_name() to return CLI.
here is my cron script.
* * * * * /usr/bin/ea-php71 /home/coin/public_html/cron/price_alerts.php >/dev/null 2>&1
I've also tried
* * * * * /usr/bin/php /home/coin/public_html/cron/price_alerts.php >/dev/null 2>&1
* * * * * php /home/coin/public_html/cron/price_alerts.php >/dev/null 2>&1
It was kind of bazaar but I had my cron jobs work a couple times and it returned CLI but most the time my cron jobs just return cgi-fcgi
-
Hi, Try below PHP executable path instead of what you are giving in it.. # /opt/cpanel/ea-php71/root/usr/bin/php Also, execute below command to see if there is any error: # /opt/cpanel/ea-php71/root/usr/bin/php /home/coin/public_html/cron/price_alerts.php 0 -
So this worked! /opt/cpanel/ea-php71/root/usr/bin/php . But now my file paths for my includes are messed up. PHP Fatal error: require(): Failed opening required '../vendor/autoload.php' (include_path='.:/opt/cpanel/ea-php71/root/usr/share/pear') in /home/coin/public_html/cron/price_alerts.php 0 -
Hello, You should use one of the following commands for PHP with your cron jobs: General example: /usr/local/bin/php /home/$user/public_html/path/to/cron/script
Domain-specific example:/usr/local/bin/ea-php56 /home/$user/domain_path/path/to/cron/script
In the above example, replace "ea-php56" with the PHP version assigned to the domain you wish to use. Look in the MultiPHP Manager for the actual PHP version assigned to a domain. Thank you.0 -
Yes if I /usr/local/bin/ea-php71 then my cron script won't recognize CLI. The only way I can get it to recognize CLI is by using /opt/cpanel/ea-php71/root/usr/bin/php. But now my includes paths are messed up. 0 -
Yes if I /usr/local/bin/ea-php71 then my cron script won't recognize CLI. The only way I can get it to recognize CLI is by using /opt/cpanel/ea-php71/root/usr/bin/php. But now my includes paths are messed up.
Feel free to open a support ticket using the link in my signature if you'd like us to take a closer look. Thank you.0
Please sign in to leave a comment.
Comments
5 comments