1
votes

I ma trying to import xml file to my new wordpress when i am trying to import after 1 minute i am getting the below error:

Fatal error: Maximum execution time of 60 seconds exceeded in C:\wamp\www\demo6\wp-includes\wp-db.php on line 1811

i added below line to wp-db.php but still iam getting same error

ini_set('max_execution_time', 1900); 

and in php.ini i changed too still same error

max_execution_time
3
Did you restart the server after changing php.ini?Gerald Schneider
yes i did that is a common thingShaik

3 Answers

3
votes

Check all your resource limits first. You can use the PHPinfo Plugin to check the resource limits. If all the limits are appropriate follow the step below:

Add set_time_limit(1000) in the wp-includes/class-http.php file. Check the below code:

<?php
/**
* HTTP API: WP_Http class
*
* @package WordPress
* @subpackage HTTP
* @since 2.7.0
*/

set_time_limit(1000);

if ( ! class_exists( 'Requests' ) ) {
require( ABSPATH . WPINC . '/class-requests.php' );

Requests::register_autoloader();
Requests::set_certificate_path( ABSPATH . WPINC . '/certificates/ca-bundle.crt' );
}
1
votes

ini_set('max_execution_time', 1900);

if you want to disable this limit, set it to 0. However, this parameter may also be not alterable if server is set so (which is a case on many hostings)

1
votes

Go to this file: wp-includes/deprecated.php and find this:

@set_time_limit ( 60 );

just comment out this line and it works fine.

Because WordPress hard coded that 60 seconds limit, this hard coded setting was over-read php.ini settings. so comment out that line, and php.ini settings will start working again.