How is it possible to set an infinite execution time for a PHP script?

  • Set the max_execution_time directive in the php.ini file to 0
  • Use the set_time_limit(0) function at the beginning of the PHP script
  • There is no way to set an infinite execution time for a PHP script
  • Use the unlimited_execution_time() function at the beginning of the PHP script
To set an infinite execution time for a PHP script, you can use the set_time_limit(0) function at the beginning of the PHP script. This function sets the maximum execution time for the script to 0, effectively removing any time limit. Additionally, you can also modify the max_execution_time directive in the php.ini file and set it to 0. It's important to note that setting an infinite execution time may have implications on server resources and may not be recommended for all scripts. It's advisable to use this with caution and only when necessary.
Add your answer
Loading...

Leave a comment

Your email address will not be published. Required fields are marked *