I have a one off web request that I need to send via a Wordpress page hosted on my server.

The request takes a long time because it's processing a lot of data; unfortunately, the page returns with an error page before the request has had time to completed. (There's nothing wrong with the request per se; I know, because when I pass it a smaller set of data, it completes with no problems.)

My question is:

What settings can I change on the server to increase the length of time that passes before the server kills the request?

So far I have changed these:

  • In /etc/httpd/conf/httpd.conf: Timeout.
  • In /etc/php.ini: default_socket_timeout and mysql.connect_timeout.
  • In /etc/my.cnf: connect_timeout, wait_timeout and interactive_timeout

But none of these changes make a difference.

  • How are you testing this connection? Are you using wget or curl? – slm Jan 12 '14 at 6:37
  • @slm, I'm not sure what you mean by 'testing the connection', but I am making a request that uses a connection to my server. I am making this request via a wordpress page that is hosted on my server. – Tola Odejayi Jan 12 '14 at 6:59
  • Are you using a browser to do this? What is the request? Is it javascript pulling another server, we need more information. – slm Jan 12 '14 at 7:56

In your php.ini, adjust max_execution_time.

  • That was a good suggestion, and I was about to jump for joy at having got a solution... but when I tried it, it didn't work. I'm wondering whether there is some php code that can be used to override whatever is in the php/apache settings. – Tola Odejayi Jan 12 '14 at 7:07
  • Indeed, PHP has a lot of methods to override settings in the INI file. Look in your code for any instances of ini_set() calls. Also, check your server logs for what may be helpful information when the attempts fail. – DopeGhoti Jan 12 '14 at 7:55

You can try to tweek the script itself using set_time_limit() and extend as ad libitum, see doc at http://www.php.net/manual/en/function.set-time-limit.php

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.