We are aware of a potentially service impacting issue. Learn more

Cron and CLI with cPanel and EasyApache 4 Print

  • 3

Need to run a cron as CLI on new cPanel servers? (easyapache 4) you may search for the following; php-cli has been replaced.

You should for cron always specify the full path to your php version.

so i.e.

/usr/local/bin/php /home/USERID/public_html/bin/magento setup:cron:run

Previously php-cli was used to get this done, however as since EasyApache 4 in cPanel a user can select their own PHP version ; this means that if you need php-cli you need to start /usr/local/bin/php and not /usr/bin/php

see below part of the documentation at: https://documentation.cpanel.net/display/EA4/EasyApache+4+and+the+ea-php-cli+Package

The ea-php-cli package is EasyApache 4's replacement for the system-provided /usr/bin/php binary. This package automatically determines which PHP version that the user's application requires from the system. 
While the stock version of the /usr/bin/php binary assumes a single version of PHP, cPanel & WHM's ea-php-cli package determines the correct version of PHP to execute, and is a key component of the MultiPHP environment. 
What does the ea-php-cli package do?

The ea-php-cli package installs the following PHP binaries:

/usr/bin/php — This executable uses the php-cgi binary for the specified PHP version. 
/usr/local/bin/php — This executable uses the php-cli binary for the specified PHP version. 
/usr/bin/lsphp — This executable uses the lsphp (Litespeed) binary for the specified PHP version. 

These binaries ensure that your system uses the correct PHP handler for your request. 

So change your cron as suggested and it will work.


Was this answer helpful?

« Back