Increase max_execution_time in php?

     

The maximum execution time for your PHP scripts and applications are defined by the max_execution_time directive sầu. PHP will timeout & exit with a fatal error once it reaches the time limit.Fatal error: Maximum execution time of 30 seconds exceeded in yourscript.phpIf not configured, the mặc định maximum execution time for a PHP script is 30 seconds.

Bạn đang xem: Increase max_execution_time in php?

*
You can mix PHP"s time limit by configuring max execution time option so that your script won"t timeout and exit with error.
This approach will affect all the PHP scripts running in your system. It"s the best solution if you"re running nội dung management system or framework lượt thích Wordpress or Drupal as you don"t need to lớn configure the option manually lớn all the affected scripts.Set the max_execution_time in your PHP configuration file khổng lồ the number of seconds that want lớn allow your PHP scripts khổng lồ exexinh tươi.

Xem thêm: Gửi Sơ Đồ Trang Web Lên Google Search Console, Cách Gửi Sơ Đồ Trang Web Đến Google


Look for max_execution_time directive.; Maximum execution time of each script, in seconds; http://php.net/max-execution-time; Note: This directive is hardcoded lớn 0 for the CLI SAPImax_execution_time = 30
It"s not recommended to lớn mix the value to 0 at this level as this method"s system-wide change will cause any misbehaved PHP scripts khổng lồ unnecessarily consume precious CPU time.
This is basically the same as the previous solution, but it"s actually a function that you Điện thoại tư vấn from your PHP script. It"s a general function khổng lồ override any configuration options set in your PHP"s configuration tệp tin and will only affect the execution of the scripts that Gọi the function.When placed at the start of your PHP script, the following function gọi will allow it to lớn run for 300 seconds (5 minutes).ini_set('max_execution_time', 300);For CMS and frameworks, it should be placed in shared files such as the configuration files. For Wordpress it"s wp-web1_settings.php.
*


*

Author: Mohd Shakir ZakariaCloud architect by profession but always consider himself as a developer, entrepreneur & an opensource enthusiast.
*
*