WordPress: Fix for Download failed

WordPress: Fix for Download failed – Operation timed out

Posted by Stefan Schwalm on January 4, 2010

This annoying problem does not occur very often, sometimes this problem will actually only be noticed by people whose WordPress or server is connected to a (relatively) slow or overloaded internet connection. It is then expressed when you trigger an update of WordPress, a plugin or a theme, after 60 seconds you get exactly this error message.

Download failed.: Operation timed out after 60000 milliseconds with X out of Y bytes received

For my taste, the timeout at this point is a little too short at 60 seconds. Anyway, here’s a quick guide on how to customize it yourself.

First the file wp-admin/includes/file.php of the relevant WP installation in an editor (e.g. Notepad under Windows) and look for the following line 448.

$response = wp_remote_get($url, array('timeout' => 60));

the value behind timeout can then be adjusted as desired. I would recommend a new value of 300 = 5 minutes.

$response = wp_remote_get($url, array('timeout' => 300));

After that, there shouldn’t be any more problems during an upgrade.

updated:

By updating the WordPress installation, this file may be overwritten again and the value reset to the default 60 seconds! At least you know in the future where you can turn off the problem.

Left

Solve Operation Timed Out Error When Upgrading WordPress

Previous post Install WordPress locally – explained step by step
Next post Download XAMPP