first of all: sorry if this has already been answered. I made multiple searches and tests, but couldn't find a real answer to my question (some answers but for <7.0.0).
Issue: I would like to increase the max execution time for a given script (let say 5 minutes), and this script only. I want my other scripts to keep using the .ini max execution time (30 seconds).
My .ini has a max exec time at 30 seconds. In the begining of the said script, I tried:
set_time_limit(0);
ini_set('max_execution_time', 0);
But it seems to have no effect, my script always timeout after 30s (.ini value). From what I could read on SO, those methods only work if "PHP Safe mode is disabled". But, from the PHP website :
This feature has been DEPRECATED as of PHP 5.3.0 and REMOVED as of PHP 5.4.0.
From SO:
This function has no effect when PHP is running in safe mode. There is no workaround other than turning off safe mode or changing the time limit in the php.ini.
So my questions:
- does
set_time_limit
andini_set('max_execution_time', 0)
should work without additionnal .ini config since PHP 5.4.0 ? (and so, on PHP 7.4.8) - I don't want to set 5 minutes in my .ini, so what is the real way to make only 1 script have a longer max execution time?
- Now that there is no more safe mode, those methods should work anytime?
Thanks a lot