1

I am testing a page generated by a script that performs some operations and redirects to another script. It times out at ~ 60 seconds although the max_execution_time is set to 300.

Other revelant settings could be:

mysql.connect_timeout   60
default_socket_timeout  60

Would these be causing this behavior?

siliconpi
  • 1,707
  • 6
  • 30
  • 45
  • If its the *page* that shows a timeout, perhaps "504 Gateway Time-out", then the PHP script might still be running. See other settings in Apache (not PHP related). – ToolmakerSteve Apr 04 '19 at 20:26

4 Answers4

1

In PHP did you use the function

Déjà vu
  • 5,408
  • 9
  • 32
  • 52
  • 1
    FYI - this command is analogous to setting `max_execution_time` in `php.ini`, which the OP has already done. – EEAA Sep 25 '10 at 14:52
  • `max_execution_time` is a php.ini directive as you said, but I suggest to try the `set_time_limit()` at the top of the PHP script to ensure there is no configuration issue. – Déjà vu Sep 25 '10 at 15:01
  • 3
    Sure, well a check of `phpinfo()` would verify whether or not `max_execution_time` is being set correctly by the `php.ini`. – EEAA Sep 25 '10 at 15:06
1

It's also possible that your PHP configuration could be overriding it. For example, I once had set php_value max_execution_time 600 in my Apache VirtualHost configuration on the <Directory> of my Drupal 5 install, but a file in Drupal 5 core has a line that containss max_execution_time 240. Because the Drupal code was processed later, it overrode the Apache configuration option.

The solution for me to "force" my declaration was to set it in Apache as php_admin_value max_execution_time 600. The php_admin_value means that PHP scripts cannot change the value you set it to.

Alan Ivey
  • 1,699
  • 12
  • 16
0

Is it possibly hitting the memory_limit set in php.ini? Run top while the script is running and see if its memory consumption increases to near the set limit before timing out.

I would highly doubt that the current settings for mysql.connect_timeout and default_socket_timeout would be causing any problems.

Also, just to make sure, you did restart apache after making the php.ini changes, correct?

EEAA
  • 108,414
  • 18
  • 172
  • 242
0

This could have been re-configured in a .htaccess file somewhere within the site (or superior folders).