Skip to main content

CLI not recognized in cron jobs

Comments

5 comments

  • 24x7server
    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
  • krisko24
    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
  • cPanelMichael
    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
  • krisko24
    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
  • cPanelMichael
    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.