Reputation: 31
I have 3 Questions about set_time_limit() function in PHP :
set_time_limit()
. What can I do?Upvotes: 0
Views: 868
Reputation: 2150
To 1:
Yes a user may call the function even if they don't have access to the php.ini. You may use safe_mode(DEPRECATED and REMOVED in 5.4) or the disabled_functions
ini directive to avoid this. However, set_time_limit
is potentional misleading (read below). If you don't want to change the php.ini it might in a web context be possible to set the max response-time at the server level or the used cgi config.
To 2 also answers 3:
Disallow the function and/or set max_execution_time
.
Note: set_time_limit
counts the execution time of the current running php script, not the time the script spends waiting on external ressources (Exception ofcourse on windows).
Upvotes: 1
Reputation: 23361
Your three questions is easily answered by the PHP Manual - set_time_limit function of set_time_limit
function.
1 - A user only don't have permissions to change the php.ini when it doesn't have the permissions to do so through the file system
2 and 3 - You can change the max_execution_time
on php.ini if you have the right permissions. Put on it a huge value (it is not recommended though)
Upvotes: 1