Cronjob Reference an account's default ea-php
Is it possible to use an account's WHM assigned ea-php version in the command line, instead of it being hard coded? Or, maybe to use the System PHP version? (Account Cpanel - PHP Selector does not allow a choice.)
For example, by emulating this:
with some 'php' that uses the account's assigned version. What I want to accomplish is having all crons jobs change PHP version as the account's version is changed. On this
/usr/local/bin/ea-php72 /home/account/path to/file.php
with some 'php' that uses the account's assigned version. What I want to accomplish is having all crons jobs change PHP version as the account's version is changed. On this
-
Its real easy. cd /home/account/path to/ && php -q ./file.php
Since the default version of the system is ea-php72, the file is executed with that. Incidentally, you can still use environmental variables and arguments like so:cd /home/account/path to/ && ENV=var php -q ./file.php argument1 "argument 2"0 -
Hello David, Here's the document that explains how this works: EasyApache 4 and the ea-php-cli Package - EasyApache 4 - cPanel Documentation Let me know if this helps. Thank you. 0 -
Thank you Michael! That"s good info. Which binary gets used if the command only contains "php"? (As I"ve used in today"s 8:45am post.) 0 -
Hello David, Here's the part of the document relevant to that question: [QUOTE] The system default php.conf file The system uses the /etc/cpanel/ea4/php.conf file to determine the system's default PHP version and the PHP handler that each PHP version uses. If a PHP file's PHP version is not explicitly set, the system uses the default entry in the /etc/cpanel/ea4/php.conf file to determine which version of PHP to use. Set the system's default PHP version and an individual domain's PHP version in WHM's /usr/local/cpanel/bin/rebuild_phpconf script. For more information, read our 0
Please sign in to leave a comment.
Comments
4 comments