What to put in cron command?
If the following is used as the cron command, all works great.
With only
the same file will not run under cron and 500 Server Error will result. Using 'php' it does run with PHP 7.2, but does throw an error and I cannot find the reason why. My ultimate goal is to make the cron use the default php version set in WHM, so that the crontab does not need to be edited as the account's php is updated.
/usr/local/bin/ea-php72 /home/path to/file.phpWith only
php /home/path to/file.phpthe same file will not run under cron and 500 Server Error will result. Using 'php' it does run with PHP 7.2, but does throw an error and I cannot find the reason why. My ultimate goal is to make the cron use the default php version set in WHM, so that the crontab does not need to be edited as the account's php is updated.
-
Are you using CloudLinux? What does the command which php show? 0 -
What does the command which php show?
# which php /usr/local/bin/php
and# which ea-php72 /usr/local/bin/ea-php720 -
What about md5sum /usr/local/bin/php and cat /home//.htaccess Replace with the username that this cron is running under. 0 -
What about md5sum /usr/local/bin/php and cat /home//.htaccess Replace with the username that this cron is running under.
Thank you for replying. I don't understand what you are suggesting. cat returns no such file or directoryAre you using CloudLinux?
Yes0 -
Well.... without direct answers to my questions, it's hard to diagnose anything. I would presume that /usr/local/bin/php is referencing a CloudLinux, alt-php binary instead of cPanel's PHP. So when you call cPanel's PHP directly - /usr/local/bin/ea-php72 - this works differently than when calling - /usr/local/bin/php - which is CloudLinux's version. But I would suggest that you talk to cPanel or CloudLinux if you have questions about this. 0 -
Additionally, if you are using CloudLinux and CageFS, you may get different results for /usr/local/bin/php whether you are logged in as root or if you are logged in as the user. 0 -
Cpanel moderator, please close and/or delete this thread. The title is misleading. 0
Please sign in to leave a comment.
Comments
7 comments