Web Hosting Forum | Lunarpages

Author Topic: Cron-launched php script fails in lpcp - ok in cpanel  (Read 11354 times)

Offline aw99

  • Newbie
  • *
  • Posts: 5
Cron-launched php script fails in lpcp - ok in cpanel
« on: September 18, 2012, 01:46:28 AM »
A php script launched in cron on lpcp failed, whereas the same script works ok on a cpanel account (I have both).  Because of compile errors not showing on lpcp setup it was failing with white screen of death which produced no results - i.e. it looked as though the cron wasnt running.  Lp support hung in there with me on this for a couple of weeks (!).  But they were very focussed on "our stuff working brill - must be your stuff going wrong".  This encouragement did keep me on the debugging trail.  I'm pretty sure the prob is that the $_SERVER variables output /usage whatever is different on lpcp cron.  I didnt actually get to the bottom of the issue.  I just got cron to run the script with curl instead of php and it works ok.

Offline MrPhil

  • Senior Moderator
  • Berserker Poster
  • *****
  • Posts: 6230
Re: Cron-launched php script fails in lpcp - ok in cpanel
« Reply #1 on: September 18, 2012, 04:56:41 AM »
Sorry to hear that you had trouble with cron.

Something to always keep in mind when using cron is that you can never make any assumptions about the exact starting directory, environment variables, PATH, PHP version available, server settings, or much else. You always have to hard code in all these things.
Visit My Site

E-mail Me
  
-= From the ashes shall rise a sooty tern =-

Offline dwaynnyt

  • Intergalactic Cowboy
  • *****
  • Posts: 64
Re: Cron-launched php script fails in lpcp - ok in cpanel
« Reply #2 on: January 04, 2014, 10:28:04 AM »
I guess for me, it's like  a trial and error thing. Just make sure that you learned something from that experience though.
« Last Edit: January 04, 2014, 10:30:37 AM by dwaynnyt »

 

Share |