Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Fixing my crontab


clustersolutions

Recommended Posts

I had read some posts in the past on encountering phantom cron job errors, i.e. a php script runs in a command shell but not via cron. Well...until I encountered the same error after our PHP 5.5 upgrade...this is how I fixed ours tonite...

 

1) Look for error log. Nope, nothing in error_log so I login to cpanel and find that it has a feature to email you the cron log upon a job is finished if it was setup correctly. I set mine up by giving it my email and comment out the std out to null device.

 

2) Caught the error via email that said "directive register_global is no longer available in php in unknown on line 0". So, this must have some to do with the php upgrade.

 

3) login to the ssh shell...did a whereis and found two copies of phps...so the scripts was still pointing to the old php and I really had needed to use the php 5.5. you can get the php version using php -v.

 

So that was it...so whenever you encounter any error be sure to get to any error log...it's important...I hope I don't read another phantom cron job error ever again...

 

burning the midnight oil to meet demo deadline...web dev is soooo under appreciated...

 

Link to comment
Share on other sites

haha, I was using the 2AM to 4AM window to see if anything still breaks under php 5.5 after I fixed UTF with BOM and removed extra blank lines from php files

KEEP CALM AND CARRY ON

I do not use the responsive bootstrap version since i coded my responsive version earlier, but i have bought every 28d of code package to support burts effort and keep this forum alive (albeit more like on life support).

So if you are still here ? What are you waiting for ?!

 

Find the most frequent unique errors to fix:

grep "PHP" php_error_log.txt | sed "s/^.* PHP/PHP/g" |grep "line" |sort | uniq -c | sort -r > counterrors.txt

Link to comment
Share on other sites

Always keep in mind that a cron job may execute in a much different environment that a .php file run from your browser. Don't count on the PHP version or configuration being the same, or having the same environment variable settings, or starting with the same current directory. All these things should be carefully and explicitly configured in a cron job, so you know exactly what's going on.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...