Fatal error: Maximum execution time of xx seconds exceeded…

This error appears when a PHP process takes longer than the time your server allows. A WPeMatico campaign that reads many feeds, downloads images or gets the full content of each item can need more time than the default limit of many servers, usually 30 seconds.

Fatal error: Maximum execution time of 30 seconds exceeded

Check Your PHP Time Limit
WPeMatico shows it for you.

Go to WPeMatico β†’ Tools β†’ System and find PHP Time Limit in the PHP Environment table. If it is lower than 180 seconds, WPeMatico shows a warning. We recommend 300 seconds, which gives a campaign 5 minutes to run.

Php time limit in the wpematico system tab

Set the Campaign Timeout
In the WPeMatico Settings.

Go to WPeMatico β†’ Settings and find Timeout running campaign in the Advanced Fetching box. The default value is 300 seconds. When a campaign runs, WPeMatico asks PHP for this amount of time, and if a campaign is interrupted, it is released after this timeout so it can run again on the next schedule.

Timeout running campaign option in the wpematico settings

Some hosts don’t allow plugins to change the time limit. In that case, the limit of the server is the one that counts, and you must increase it with one of the methods below.

Note: When a campaign is interrupted by a timeout, the campaigns list shows a red message Timed out after X sec. under the campaign, with the date it happened.

Increase the Limit on Your Server
Use the method your hosting allows.

  1. Ask your hosting provider. It’s the easiest and safest way: just ask them to set max_execution_time to 300.
  2. From your hosting control panel. Many panels, like cPanel or Plesk, have a PHP settings page (for example Select PHP Version β†’ Options or MultiPHP INI Editor) where you can change max_execution_time.
  3. In the php.ini file, if you have access to it:

    max_execution_time = 300

  4. In the .htaccess file, only on Apache servers running PHP as a module:

    php_value max_execution_time 300

    If your site shows an Internal Server Error after adding this line, remove it: your server doesn’t support it.

After the change, reload WPeMatico β†’ Tools β†’ System to confirm the new value of PHP Time Limit.

Note: If campaigns still stop, reduce the work done in each run, for example with fewer items per fetch in Max items to create on each fetch.

Related FAQs