The default maximum execution time of a php script is 30 seconds. If a php script is not finished in 30 seconds, this error will occur. In this tutorial, we will introduce how to fix this error.
We will introduce you two ways, you can select one to do.
Method 1: Edit your .htaccess file
If you have installed Yoast SEO or WP File Manager plugin, you can edit .htaccess online. Here is the tutorial.
Otherwise, you have to use a ftp client to connect your site server to edit .htaccess file, which is not a good choice.
You can add code below in your .htaccess file.
php_value max_execution_time 300
This code will set php maximum execution time to be 300 seconds.
Method 2: Edit php.ini
If you can edit php.ini file, you can set php maximum execution time easily.
After you have edited php.ini file, you must restart apache, tomcat, nginx or other server application to make it work.