How to increase PHP Execution Time

JavaScript Array, search value increase PHP Execution Time connect multiple database display source code save image Export MySQL Database configure mongodb send email from localhost

Here is the method  for How to increase PHP Execution Time.Default maximum PHP Script Execution Time is 30 seconds, But if you need to process big file then you may have seen your script got crashed, and It throws script execution timeout error. So if your project required to process huge file like exporting big CSV file from MYSql, Then you need to increase PHP Script Execution Time, You can easily increase script execution time by following two ways.

Also Read:How to connect multiple database in php mysqli, PDO

Here is Step for increase PHP Execution Time

By php.ini file

Open php.ini file in any text editor and find following line max_execution_time and edit it’s value.

max_execution_time = 300 // 300 seconds = 5 minutes


Add following code on the top of the page, Where long process need to execute.

ini_set('max_execution_time', 300); // 300 seconds = 5 minutes

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.