php not found

pucky

Verified User
Joined
Sep 9, 2006
Messages
757
I'v exhausted the endless search to find out why php cron jobs are failing under DA.

I have a bunch of invoices that never generated because cron jobs are failing. I have about 300 error messages being sent to my admin account the only error;

php not found.

So i turned of open basedir and that didnt help. Open base dir is not supposed to prevent php cron jobs from running from the control panel anyway.

I removed the crons from the control panel and added them to crontab. Still, same problem. Error; php not found.

which php says php is located in; /usr/local/bin/php. I check php.ini and sure enough /usr/local/bin/php and /usr/bin/php are part of the include_path.

So what is the problem? Surely, php can be found when run as root from crontab but not on DA.

The sage continues...

Now here is the catch. I can run the command from the command line. All of a sudden my invoices generate. What gives?

The command is simple enought;

php -q -f /home/efast/public_html/acct/tools/master_cron.php /home/efast/public_html/acct >/dev/null 2>&1 produces errors from crontab as well as DA's control panel. And that is one, i have 5 more all producing the same error.

...and i shouldnt have to prefix the cron with /usr/local/bin/php in order for it to get picked up. Thats the reason we have something called include_path in php.ini. Never had to do it on cPanel, why should we have to do it with DA?
 
Last edited:
Amazing, even prefixing the cron job with the path to php produces errors. Now im getting a permission denied error



/usr/local/bin/php: Permission denied



:mad:
 
Last edited:
When running cron jobs, you ALWAYS have to assume you have the bare minimum environment (PATH=/bin:/usr/bin) and nothing else. /usr/local/bin is not part of the default environment, so if you want to use that in a cron job, then you need to include it.

The include_path in php is for finding php files, not the php executable, the php executable can only be found by using the full path or adding the path the the PATH environment variable.

What is the uid/gid of the user trying to execute /usr/local/bin/php and what are the actual permissions of /usr/local/bin/php?
 
Back
Top