Αποτελέσματα Αναζήτησης
23 Ιουν 2016 · Increasing the timeout in php.ini by adding a line: max_execution_time = {number of seconds i.e. 60 for one minute} Increasing the timeout in your script itself by adding: ini_set ('max_execution_time',' {number of seconds i.e. 60 for one minute}');
set_time_limit (int $seconds): bool. Set the number of seconds a script is allowed to run. If this is reached, the script returns a fatal error. The default limit is 30 seconds or, if it exists, the max_execution_time value defined in the php.ini. When called, set_time_limit () restarts the timeout counter from zero.
After reading all the answers, I just want to add, that it is not possible to set max_execution_time in any of the ini files (php.ini, php-cli.ini, etc.) for it to change effect when running CLI scripts. This behaviour is described here: php.net/manual/en/features.commandline.differences.php
21 Μαΐ 2023 · If you want to change the timeout value, you can modify this directive in the php.ini file, or you can also set it programmatically within your PHP script using the ini_set() function or the set_time_limit() function.
However, it appears that any max_execution_time set in /etc/php.ini actually will not affect the CLI scripts - even if the file is being properly loaded (use phpinfo() to find out) - so you must use one of the other methods mentioned above.
11 Ιουλ 2008 · set_time_limit has another advantage, you can call it several times and it adds the time to the total script runtime. so you can use it in a loop and it doesn’t matter how many iterations you have, you set only the time per iteration.
18 Οκτ 2023 · There are 4 ways to change the execution time limit in PHP: Change max_execution_time = SECONDS in php.ini. On an Apache webserver, add php_value max_execution_time SECONDS in the .htaccess file. Use set_time_limit(SECONDS) in the PHP script. Finally, we can set the time limit using ini_set("max_execution_time", SECONDS).