How to set infinite execution time in a PHP script

PHP: How to set infinite execution time in a PHP script

Add the following code to set unlimited execution time for a PHP script:

  1. set_time_limit(0)

You can also update max_execution_time in php.ini

If the value is 0, it is actually unlimited. Otherwise it is that number of seconds.

webdevetc profile pic
webdevetc

I am a 29 year old backend web developer from London, mostly focusing on PHP and Laravel lately. This (webdevetc.com) is my blog where I write about some web development topics (PHP, Laravel, Javascript, and some server stuff). contact me here.



More...


Comments and discussion about How to set infinite execution time in a PHP script

Found this interesting? Maybe you want to read some more in this series?

Or see other topics in the PHP language

Or see other languages/frameworks:
PHP Laravel Composer Apache CentOS and Linux Stuff WordPress General Webdev and Programming Stuff JavaScript
Or see random questions

What is the spaceship operator (<=>) in PHP?

A list of operators on Eloquent's where() method

How to query mysql using PDO in PHP?

How to add and remove items to an array in JS?

How to disable file hotlinking in Apache with .htaccess

How to set up an alias to map one directory to another destination

How to convert between types in JS?

How to set up custom error pages in .htaccess for your Apache server (ErrorDocument)

How to convert a string to an array of it's characters in PHP?

What is WordPress default Apache .htaccess rules?