If you’re hosting WordPress on a shared platform, you’re limited in most cases by how the hosting provider’s systems are configured. This brief tutorial shows you how to resolve this frequent error when running WordPress on some platforms: ‘Fatal error: Maximum execution time of 30 seconds exceeded’ The error above mostly occurs when you’re trying to update a WordPress plugin or theme. and it happens when a PHP code in WordPress takes a long time to run and reaches the maximum time limit set on the server. This can be configured in a PHP configuration file or within WordPress configuration. By default, the maximum execution time is set between 30 – 60 seconds after PHP is installed. Sometimes, it takes a long time to update, and upload themes, and plugins in WordPress. If it takes longer than 30 seconds, the PHP process will fail and display that error. Below is how to resolve this:
Hosting WordPress on a Dedicated (Ubuntu) Server
If you’re hosting WordPress on a dedicated server with root access via SSH, then you simply run the commands below to open PHP main configuration file. First, determine when PHP is loaded from. A simple way to find where the PHP default configurations file is stored is to run the command below When you run the command above, you’ll see a list of locations for PHP module configurations. The main file you’re looking for is the Loaded Configuration File. This is the default configuration file that is loaded each time PHP runs. Now that you know, simply run the commands below open PHP default configuration files. (Apache2, Nginx, and CLI) Then use the down arrow key to scroll down in the file and modify these highlighted lines. You should see the section that reads “PHP Limits”, below that you’ll find the PHP default file maximum upload size as well. When you’re done changing the lines to suit your environment, save and exit. then restart your webserver and PHP. Each line above works with Apache2, Nginx, and Nginx with PHP-FPM.
Shared Hosting Environment
If you’re on a shared hosting environment with web-based access to your files from a hosting tool, then use the steps below to configure. From the root directory where WordPress files are, you’ll mostly see a .htaccess file there. WordPress uses this file to manipulate how Apache (server) serves files from its root directory and subdirectories. If you’re running WordPress on a host using Nginx, then this file might not be useful. Since host hosting providers offer Apahce2 Web hosting, you might see one. Browse to the WordPress directory. Go to the root directory, it’s the directory where you can find your wp-config.php file. You should be able to find your .htaccess file. Download a copy of it onto your computer to save it as a backup. Open it and added the highlighted line If you’re using FTP/sFTP to connect to your host and edit. then edit the file and add the lines above. then save to upload the changes. Once you’re done. try to do what you couldn’t do before. In most cases, the settings above should resolve your problem. If not, then you may have other issues at the system’s level. Contact your host provider for assistance. That should do it! Hope you like this post. You may also like the post below: