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

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


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

How to order a Laravel hasMany relationship?

How to fix the MySQL related "Specified key was too long error" error in Laravel

How to find an item by Primary Key in Eloquent, or throw a ModelNotFoundException exception if it isn't found?

Why should you update APP_URL from from http://localhost?

How to output (echo/print) content in PHP

How to set custom HTTP headers in Apache (by editing .htaccess)

How to set the timezone to UTC in .htaccess

What is Bubble sort, and how to write an implementation of it in PHP

301 Redirect a single URL in .htaccess to a new location

How to undelete a soft deleted Eloquent row?