To change the max_execution_time for PHP in Ubuntu, you can follow the steps given below:
First, locate your
php.inifile by running the following command in the terminal:sudo find / -name "php.ini"This will search for the
php.inifile in your system.Once you have located the
php.inifile, open it in a text editor such asnanoby running the following command:sudo nano /path/to/php.iniReplace
/path/to/php.iniwith the actual path to yourphp.inifile.Search for the line that says
max_execution_timein thephp.inifile. You can use the search function in your text editor to find it quickly.Change the value of
max_execution_timeto the desired value, in seconds. For example, if you want to increase the time limit to 120 seconds, set it to:max_execution_time = 120Save the changes you made to the
php.inifile (in nano you can do that by pressingCTRL + X, thenY, thenENTER).Finally, restart the Apache server by running the following command:
sudo service apache2 restartThis will apply the changes you made and restart the Apache server for the changes to take effect.
That’s it! You have successfully changed the max_execution_time for PHP in Ubuntu.