Problem with PHP timeout

I'm having a problem with a PHP process timing out on my linode.

I've updated php.ini max execution time to 300. I've verified that the max execution time is set in phpinfo. However, when I'm attempting to transfer a relatively large (100mb) file to S3, I can see the cron job start but then the transfer never occurs. I'm getting the following error message in php5-fpm.log

Apr 22 19:33:24.048456 [WARNING] [pool www] child 23746, script '/home/derek/public_html/foo/public//wp-cron.php' execution timed out (30.001523 sec), terminating

Apparently something is causing php to timeout at 30sec. I'm running a LEMP stack if that matters. Any ideas on what might be causing this this timeout? Thanks.

4 Replies

http://php.net/manual/en/function.set-time-limit.php

Is it being done through php-cli?

Check /etc/php5/cli/php.ini

By default on my Debian system it's set to 30 seconds there.

Thanks for the feedback. As far as I can tell (I'm not a programmer) settimelimit() isn't called in the wp-cron.php file. So it should default to the max execution time setting?

The process should be running through php-fpm, but I went ahead and updated max execution time under cli and cgi's php.ini files and restarted php just to be safe. Still got the same error though.

Solved it! I was wondering why I was getting a timeout error instead of a max execution time exceeded error. It turns out at some point the past I had set requestterminatetimeout in php5-fpm.conf. I commented out that line and was able to get the script to run successfully.

Reply

Please enter an answer
Tips:

You can mention users to notify them: @username

You can use Markdown to format your question. For more examples see the Markdown Cheatsheet.

> I’m a blockquote.

I’m a blockquote.

[I'm a link] (https://www.google.com)

I'm a link

**I am bold** I am bold

*I am italicized* I am italicized

Community Code of Conduct