It seems set_time_limit function call has no effect when php is running with mod_fcgid (the default in webmin). Can someone tell me how to make it work?

1 Answer 1


Make sure you're editing /etc/php5/cgi/php.ini and that after editing it, you restart php-cgi. The command for that should be sudo /etc/init.d/php-fastcgi restart


To increase timelimit, you'll need to find max_execution_time in your php.ini. Default value is 30 seconds. This is required if PHP is running in safe mode.

To disable safe mode, search for safe_mode in php.ini and set it to off.

See PHP Runtime Configuration page for more info on that.

  • Thanks Saso, perhaps I should have been clearer as I was thinking of the php function call set_time_limit, will clarify this
    – giorgio79
    Apr 25, 2012 at 9:10
  • Added an edit, I assume you wanted to increase the max execution time? That should work.
    – Sašo
    Apr 25, 2012 at 9:20
  • Much appreciated for the extra info. I really would like to use set_time_limit so I am only increasing the time for one script instead of the entire server. So it is not possible to use it with fcgid?
    – giorgio79
    Apr 25, 2012 at 9:23
  • Remembered another thing: check if php is running in safe mode - though safe mode was removed in PHP 5.4
    – Sašo
    Apr 25, 2012 at 9:31

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .