Reputation: 2173
I'm running a php script via Linux (not via my browser) (php script.php). Now, I want to limit the execution time to let's say 10 seconds, which means that after 10 seconds the process will shutdown by itself. How can I do that? Already tried set_time_limit. Already tried sleep(10); exit();
None of them made the script to shutdown.
Upvotes: 1
Views: 793
Reputation: 23510
What about using set_time_limit
function? You can check documentation here
function
void set_time_limit ( int $seconds )
Upvotes: 1
Reputation: 635
Change the maximum execution time (in seconds) in php.ini configuration file.
max_execution_time = 7200
search in php.ini
Upvotes: 1