0

I have been trying to extend the timeout session of my server, but it keeps timing out at 30 secs. There is an action that I need to perform that takes longer than that and Im not able to solve this.

I added the set_time_limit and max_execution_time to my php.ini file and uploaded it to the root of my site.

set_time_limit = 4500
max_execution_time = 3600

But it doesn't seem to be taking affect, the server keeps timing out at 30 seconds.

I want to set my server time session to 10 minutes. I will lower it, I just need to perform an action. I would really like some help on this. I've be battling this for some days now and can't figure it out.

AMadmanTriumphs
  • 4,888
  • 3
  • 28
  • 44
gdinari
  • 649
  • 3
  • 11
  • 27
  • possible duplicate of [PHP Script Times out after 45 seconds](http://stackoverflow.com/questions/2700196/php-script-times-out-after-45-seconds) – Dan Rosenstark Feb 26 '11 at 21:00
  • @Yar: Thanks for the feedback. I read the post and comments and I didn't see where it mentioned duplicate scripts causing the time out – gdinari Feb 26 '11 at 21:29

3 Answers3

1

I added the set_time_limit and max_execution_time to my php.ini file and uploaded it to the root of my site.

That won't do: You either need to edit the central php.ini file (the location of which you can find out through phpinfo()), or set the time limit inside the code using set_time_limit - if PHP is configured to accept individual overrides of the limit.

Pekka
  • 442,112
  • 142
  • 972
  • 1,088
  • @Pekka: I edited my php5.ini file and tried using the set_time_limit, but it wasn't recognized. I then tried including in the header.php of my site, but it still took no effect. – gdinari Feb 26 '11 at 21:17
  • I checked php5.ini and session.gc_maxlifetime is set to 1440, but its obviously not being applied. – gdinari Feb 26 '11 at 21:19
  • Yes, I even went in my file manage and view the php.ini file and it had the value that I set – gdinari Feb 26 '11 at 22:08
  • @gdinari did you restart the server? – Pekka Feb 26 '11 at 22:22
  • Im on a shared godaddy server, but I did end all processes. It still doesn't seem to work. – gdinari Feb 27 '11 at 05:14
1

You say you've added those directives to your php.ini file, uploaded to the root of your site... But is it really this file that's used ?

You can check which .ini file(s) is/are read, by calling the phpinfo() function from one of your scripts.

When you've found which php.ini file is used, you'll have to modify that file ; and, then, you'll probably have to restart Apache, so the modification is taken into account.


As a sidenote : set_time_limit is a PHP function, and not a directive that should be used in php.ini.

Of the two lines your posted, only max_execution_time should be in your php.ini file.

Pascal MARTIN
  • 395,085
  • 80
  • 655
  • 663
  • Thanks, I ran the phpinfo() and found my php.ini file and the max_execution_time is set to the time that I want. – gdinari Feb 26 '11 at 21:27
0

Check your phpinfo() to make sure your php.ini is recognized. You may have to reconfigure your server to accept the php.ini.

Shad
  • 15,134
  • 2
  • 22
  • 34
  • Yes its being recognized: Loaded Configuration File: ...../html/php5.ini. In the php5.ini file I only have max_execution_time = 3600. – gdinari Feb 26 '11 at 21:15