Right now my call in the CPanel CRON job section is:
nice php /home/user/public_html/process.php
After the latest updates to CentOS and PHP 5.2, I now am receiving this error on all CRON jobs:
PHP Warning: PHP Startup: Unable to load dynamic library '/usr/lib64/php/modules/ssh2.so' - /usr/lib64/php/modules/ssh2.so: cannot open shared object file: No such file or directory in Unknown on line 0
To make matters worse, PHP Functions are not being recognized (like mysql_connect
and require_once
) (only in CRON scripts though from CPanel, the normal publically accessible PHP files are loading to the public internet without a problem).
From some googling, it looks like I need to run it as the user "nobody" in order for it to work correctly.
If I was at the shell, I'd do su -s /bin/bash nobody
first to act as that user, but in CPanel CRON scripts, that is not working.
UPDATE: All errors of php process file when ran from CRON, as requested:
PHP Warning: PHP Startup: Unable to load dynamic library '/usr/lib64/php/modules/ssh2.so' - /usr/lib64/php/modules/ssh2.so: cannot open shared object file: No such file or directory in Unknown on line 0
PHP Warning: PHP Startup: Unable to load dynamic library '/usr/lib64/php/modules/ssh2.so' - /usr/lib64/php/modules/ssh2.so: cannot open shared object file: No such file or directory in Unknown on line 0
Warning: require_once(../users/config/application_top.php): failed to open stream: No such file or directory in /home/username/process.php on line 34
Fatal error: require_once(): Failed opening required '../users/config/application_top.php' (include_path='.:/usr/share/pear:/usr/share/php') in /home/username/process.php on line 34
The files noted inside require_once() are indeed there, so I have no idea why it's saying this. And, it's worked for months already... I have to assume it was the yum update
that killed this.