Asked  7 Months ago    Answers:  5   Viewed   41 times

I want to increase maximum execution time in php , not by changing php.ini file.

I want to Increase it from my php file.

Is this possible?

 Answers

44
ini_set('max_execution_time', '300'); //300 seconds = 5 minutes
ini_set('max_execution_time', '0'); // for infinite time of execution 

Place this at the top of your PHP script and let your script loose!

Taken from Increase PHP Script Execution Time Limit Using ini_set()

Wednesday, March 31, 2021
 
Owen
answered 7 Months ago
32

In the comments, Minesh Patel told me to check if there is something overwriting my option, so I searched through my php.ini for Europe/Berlin and it turns out there was another date.timezone-entry that overwrote it.

Saturday, May 29, 2021
 
fret
answered 5 Months ago
86

According to what I read here around on SO the answers is:

  1. set PHP date.timezone ini directive to "UTC" (i.e. 0)
  2. let PHP print in pages the date time (UTC) as a simple Unix time stamp (a number)
  3. let Javacscript transform the UTC Unix time stamp in client time by simply doing:

    new Date(<?php echo DATE_TIME_SERVER_UTC; ?> * 1000);

Saturday, May 29, 2021
 
weegee
answered 5 Months ago
91

I have the same error, please go to

xamppphpMyAdminlibrariesconfig.default.php

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.

Wednesday, June 2, 2021
 
Asnexplore
answered 5 Months ago
49

You need to change some setting in your php.ini:

upload_max_filesize = 2M 
;or whatever size you want

max_execution_time = 60
; also, higher if you must - sets the maximum time in seconds

Were your PHP.ini is located depends on your environment, more information: http://php.net/manual/en/ini.list.php

Friday, June 4, 2021
 
muaddhib
answered 5 Months ago
Only authorized users can answer the question. Please sign in first, or register a free account.
Not the answer you're looking for? Browse other questions tagged :