You may receive the below error for your Wordpress while installing/updating themes or plugins. This issue occurs when your WordPress's PHP code takes a long time to run and reaches the maximum time limit set for your hosting account.
Fatal error: Maximum execution time of xx seconds exceeded
By default, the maximum execution time to execute a PHP code is set between 30 – 60 seconds on cPanel. It should be enough for a PHP script to run. There are three different ways to increase Wordpress maximum execution time in cPanel.
Increase PHP limit from PHP.ini file
If you have the access to the php.ini file, you can modify the maximum execution limit. If you don't find max_execution time on your php.ini file, you can add the below line to your php.ini file.
max_execution_time = 200;
Increase PHP limit from wp-config file
You can also increase the PHP time limit from the WordPress config file called wp-config.php. Just add or edit the following line to modify the PHP time limit.
Increase PHP limit from .htaccess file
If you feel comfortable increasing the maximum execution time for PHP code from .htaccess, you can add or edit the below code to your .htaccess file.
We have used 200 seconds for the example. You can enter the seconds as per your requirement.