Support » Fixing WordPress » WordPress Importer Fatal error: Maximum execution time of 60 seconds exceeded

  • After I google for solution, changing the max_execution_time setting in php.ini configuration file does not solve this problem and have no effect. The only way is to change the code by adding set_time_limit(seconds) to class-http.php file.

    Out of curious, I wonder where is the root cause which causes the php.ini setting taking no effect. At the end I come to this file /wordpress/wp-includes/functions.php, a function named wp_get_http, with @set_time_limit( 60 ) hard coded to 60 seconds.

    It sounds weird to hardcode this, may I know why? and will it be better that admin can change this value via the wp-config.php?

Viewing 7 replies - 1 through 7 (of 7 total)
  • I’m pretty sure you can just add:


    to your wp-config.php file. Just change the 60 to whatever you like.


    Thanks for your reply.

    Definitely you can have set_time_limit(60); in any php page. The question is will this added code take effect for the entire site or just the current running script when you add it to wp-config.php file?

    No worries!

    I would check with your host.. and see if they have disabled the set_time_limit() function. This can often be done for a variety of reasons, such as PHP running in safe mode.

    Or perhaps they have a max time set.. that cannot be above a certain threshold. It’s most likely a setting with them.

    I’m just curious… do you have a script timing out? 1 minute is quite a while to wait for processing data.

    Wait, did you read my question? I have solve the timeout issue. It happens when importing the Theme Unit Test Data provided by, and the root cause is because of the wordpress code have set_time_limit(60) within wp_get_http function in wordpress/wp-includes/functions.php files. I am curious why wordpress developer writing such code which is not configurable globally, with that code, changes of max_execution_time in php.ini will not have effect within the above-mentioned wp_get_http function.

    FYI, I am deploying wordpress on local machine using xampp, environment is under my control, not safe mode. Changes of max_execution_time is reflected on phpinfo, set_time_limit is not disable and working correctly.

    Lot of people who facing Execution Time Exceeded error does not know the root cause, they just simply change few different configuration files and adding set_time_limit(seconds) anywhere in different php files by luck, this will definitely screw up the maintenance of their wordpress in future. I hate those blog that simply giving solution without clearly know the root cause.

    I had the same problem in XAMPP with a time-out warning referring me to class-http.php line 1453. I checked that file and found a function called private function stream_body( $handle, $data ). I disabled this and tried again and the download worked.

    thx gregorian1949 its work like a charm, im looking for this for a long

    leekiangiap +1, i’m with you here, and no any word on WP Theme Unit Test page, about such bad things.

    You can find for an age what is the problem.


Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘WordPress Importer Fatal error: Maximum execution time of 60 seconds exceeded’ is closed to new replies.