nifCody
nifCody

Reputation: 2444

Wordpress Plugin Upload Error timeout

I need to upload a plugin in word press but each time it tells

Downloading update from http://wordpress.org/wordpress-3.7.1-new-bundled.zip

Fatal error: Maximum execution time of 30 seconds exceeded in C:\xampp\htdocs\ubuy\wp-includes\class-http.php on line 1152

this how can increase the time limit ?

Upvotes: 2

Views: 1573

Answers (1)

doublehelix
doublehelix

Reputation: 2322

I ended up editing the ...\wp_includes\class-http.php file.

Around line 1250 (depending on your version), look for the line that reads:

$theResponse = curl_exec( $handle );

and change it to read:

$timelimit = ini_get('max_execution_time');
set_time_limit(900);
$theResponse = curl_exec( $handle );
set_time_limit(max($timelimit, 30));

This stores the current timeout in a variable, sets the new timeout to 900 seconds (5 minutes should be plenty for most connections), then it performs the request, and resets the timeout to what ever it was before we began.

That has worked for me in the past. NB: v3.8.2 uses another asynchronous method to perform installs and if you're on windows, you might need to set some additional security permissions etc. to get it all working properly.

Cheers.

Upvotes: 1

Related Questions