[php] How to increase maximum execution time in php

I want to increase maximum execution time in php , not by changing php.ini file.

I want to Increase it from my php file.

Is this possible?

This question is related to php ini execution-time

The answer is


Use the PHP function

void set_time_limit ( int $seconds )

The maximum execution time, in seconds. If set to zero, no time limit is imposed.

This function has no effect when PHP is running in safe mode. There is no workaround other than turning off safe mode or changing the time limit in the php.ini.


use below statement if safe_mode is off

set_time_limit(0);

You can try to set_time_limit(n). However, if your PHP setup is running in safe mode, you can only change it from the php.ini file.


Examples related to php

I am receiving warning in Facebook Application using PHP SDK Pass PDO prepared statement to variables Parse error: syntax error, unexpected [ Preg_match backtrack error Removing "http://" from a string How do I hide the PHP explode delimiter from submitted form results? Problems with installation of Google App Engine SDK for php in OS X Laravel 4 with Sentry 2 add user to a group on Registration php & mysql query not echoing in html with tags? How do I show a message in the foreach loop?

Examples related to ini

PHP Warning: Module already loaded in Unknown on line 0 Python: How would you save a simple settings/config file? How to increase maximum execution time in php How to read and write INI file with Python3? How do I grab an INI value within a shell script? How to locate the php.ini file (xampp) PHP ini file_get_contents external url Do standard windows .ini files allow comments? Reading/writing an INI file What is the easiest way to parse an INI file in Java?

Examples related to execution-time

How to solve time out in phpmyadmin? How to increase maximum execution time in php Find out time it took for a python script to complete execution How do I get time of a Python program's execution? Maximum execution time in phpMyadmin calculating execution time in c++ What is the best way to measure execution time of a function? How do I time a method's execution in Java?