php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #19244 set_time_limit() and safe_mode
Submitted: 2002-09-05 06:34 UTC Modified: 2002-09-05 06:50 UTC
From: phpnet at shredzone dot de Assigned:
Status: Wont fix Package: Feature/Change Request
PHP Version: 4.2.2 OS:
Private report: No CVE-ID: None
 [2002-09-05 06:34 UTC] phpnet at shredzone dot de
I have a change request for set_time_limit() in combination with safe_mode.

Instead of disallowing to set the time limit at all when safe_mode is activated, you could allow the program to *reduce* the time limit, compared to the default settings.

It won't harm the server security if the developer explicitely wants his script to timeout in 10 seconds instead of 30 or maybe inifinite.

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2002-09-05 06:50 UTC] derick@php.net
We can not do this, as set_time_limit() resets the timer to 0 when it is called.
Thus you can use "set_time_limit" at the end of your loop operation and still starve the server:

<?php
while (1) {
    $a = $a + 1;
    echo $a;
    set_time_limit(5);
}
?>

Derick
 [2002-09-05 06:53 UTC] phpnet at shredzone dot de
Oops... I forgot about that. Sorry for bothering.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Dec 26 10:01:29 2024 UTC