首页 > 网站制作 > Wordpress自动升级超时 解决方案

Wordpress自动升级超时 解决方案

2009年4月3日

很久没有照顾自己的博客了,放眼望去杂草甚是丛生,一大堆的SPAM让人望洋兴叹。。。还好我忘记这地方之前装了反垃圾插件 :cool:

So now is the point, starting few days ago i tried to upgrading my wordpress installation file using the built in function in the wordpress. But the result really upset me up.Everytime i try to use the auto update , it give me error which is :

Downloading update from http://wordpress.org/wordpress-2.7.1.zip

Download failed.: Operation timed out after 30000 milliseconds with 351500 bytes received

Installation Failed

想想曾经用ZEND调试时候遇到的超时问题,自然联想到php的配置文件上,于是查看php.ini文件,将max_execution_time改为180毫秒(默认是30毫秒),自以为搞定了,无奈仍是屡试依然不爽 :twisted:
于是,在翻腾互联网翻腾wp代码的情况下,终于找到了该死的问题所在:

1. 找到wordpress管理目录下 wp-admin/includes/file.php
2. 在 file.php 找到如下代码 (第444行 :roll: ) :

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

OK,就是那个30,改成你希望的任何时间(当然,要<=php.ini里面配置的时间) :

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

So after doing this , everything will work fine. Have fun~!

网站制作 , ,

  1. 2009年4月3日21:50 | #1

    好像每次自动升级Wordpress以后又变回去了,有时间得想个更好的解决方案。。。 :sad:

  2. 2010年1月6日15:10 | #2

    用这个方法还是升级失败.我把时间改到300 结果网站报错.没办法,还是手动升级了..

  1. 本文目前尚无任何 trackbacks 和 pingbacks.