I'm trying to use PHP's set_time_limit() in a normal PHP apache script (not CLI) to limit its max running time. It's not doing anything with system calls or anything similar, we're not using safe mode (we're the owners but not the admins of the server). This is PHP 5.2.4 on Linux (Ubuntu).
Simple test case:
ini_set('max_execution_time', 1);
set_time_limit(1);
$i=0;
while ($i++<100000000000) {} // or anything other arbitrary that takes time
die('Done');
Expected result: something relating to the script execution time being exceeded
Actual result: Done is printed.
Am I doing something obvious wrong? (By the way, yes, the script really needs to and can run for too long and need to be aborted, it's unfortunately not something that can be avoided. That is not the point here.)