I have a rails app which initiates php script using: php -f aa.php
The php script has at the beginning set_time_limit(60); // 1 minute ini_set('max_execution_time',60);
But the php script does not die even after two minutes. I verified using ps -ef | grep php
and the process is still running.
Does it not die because the parent ( rails app) is alive ?
I have verified the safe_mode
is off for php
Okay, see this Note from php.net, the script won't stop because of set_time_limit as long as there is f.e. a DB query
NOTE:
The set_time_limit() function and the configuration directive max_execution_time only affect the execution time of the script itself. Any time spent on activity that happens outside the execution of the script such as system calls using system(), stream operations, database queries, etc. is not included when determining the maximum time that the script has been running. This is not true on Windows where the measured time is real.
You might set a timeout function in your loop so that it stops after a minute or whatever time you wish