Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Increase PHP Script Execution Time [duplicate]

Tags:

php

I want to send hundreds of emails using PHP. To increase the execution time, I used ini_set('max_execution_time', 10); but after sending just 30 emails the browser shows me a blank page and does not send all of the emails.

I also changed the limit to 300, 600 ..

like image 711
PHP Ferrari Avatar asked Feb 28 '11 09:02

PHP Ferrari


People also ask

How can I increase the maximum execution time of a PHP script?

To increase the script execution time, you can use the following snippet at the top of your script. ini_set ( 'max_execution_time' , '300' ); In the above example, it would set the max_execution_time directive to 300 seconds.

How do you increase the maximum execution time of 60 seconds exceeded?

Look for : $cfg['ExecTimeLimit'] = 600; You can change '600' to any higher value, like '6000'. Maximum execution time in seconds is (0 for no limit). This will fix your error.


1 Answers

Try set_time_limit(0); at the top of your script.

set_time_limit sets the maximum execution time in seconds. If set to zero, no time limit is imposed (see PHP manual).

like image 100
Richard Pianka Avatar answered Sep 28 '22 10:09

Richard Pianka