PHP + Cron Job: Maximum execution time exceeded

Avatar
  • Answered
I have a cron job that runs a PHP script (which takes ~5 hours to complete) which exits roughly half way through (~2-3 hours) with a max execution time exceeded error:
PHP Fatal error: Maximum execution time of 0 seconds exceeded

I have the following modified PHP configuration variables:
max_execution_time = 0
max_input_time = -1

If I run the PHP script from a console, it completes without the error. The error only happens when running from a cron job.

Anyone know what might be causing this?
Avatar
Scott
Hello,

Thank you for your question on max PHP timeout setting. If the time is set to anything, then it will not matter whether the script is executed on the console or browser. However, with CRON setup, it is still run via console, so it should have the same result.

You will want to contact our Live Support so they can check your account specific log files for errors or see if anything else is interfering with the script at the time of failure.

Kindest Regards,
Scott M