2014-02-19 47 views
1

我在升級Wordpress時遇到問題,而且我的搜索結果並未發現解決方案。希望你可以伸出援手。5000毫秒後Wordpress更新操作超時

問題

我試圖更新運行WordPress的3.7 WordPress的3.8.1網站,但它在推動「立即更新」按鈕拋出下面的錯誤。

Downloading update from https://wordpress.org/wordpress-3.8.1-new-bundled.zip

Download failed.: Operation timed out after 5001 milliseconds with 736947 out of 6333109 bytes received

Installation Failed

額外的信息

  • 這是發生在我的本地MAMP開發環境作爲服務器沒有權限做了現場升級。我希望能夠運行升級,提交代碼更改,然後推送到服務器進行測試。

An unexpected error occurred. Something may be wrong with WordPress.org or this server’s configuration. If you continue to have problems, please try the support forums.

Try again

+0

做一個手動更新:http://codex.wordpress.org/Updating_WordPress#Manual_Update – RRikesh

+0

這是在本地主機上? –

+0

@ObmerkKronen是的,這是在本地主機 – davur

回答

5

得到我的手髒了調查後發現:

  • 下載zip文件打「下載3.8.1」
  • 另外,可能相關,問題是發生在Plugins > Add New > Popular這也引發一個錯誤,當細在Wordpress源文件中,我能夠將該問題追蹤到稱爲「更多字段」的插件中的破壞性過濾器。我已禁用並卸載了插件,並且所有升級都再次運行。對於那些好奇

    細節我跟蹤它到這條線在WP_Http_Curl::request()

    curl_setopt($handle, CURLOPT_CONNECTTIMEOUT, $timeout); 
    

    功能的默認超時爲5,但是WP_Upgrader::upgrade()實際上調用通過傳遞一個一個download_package函數的函數300秒超時。這裏

    的罪魁禍首是插件「更多的領域」,其中包括以下過濾器打破了參數數組,因此重新設置默認的超時:

    // Prevent auto update to this custom plugin 
    add_filter('http_request_args', 'prevent_update_check', 10, 2); 
    
    function prevent_update_check($r, $url) { 
        if (0 === strpos($url, 'http://api.wordpress.org/plugins/update-check/')) { 
         $my_plugin = plugin_basename(__FILE__); 
         $plugins = unserialize($r['body']['plugins']); 
         unset($plugins->plugins[$my_plugin]); 
         unset($plugins->active[array_search($my_plugin, $plugins->active)]); 
         $r['body']['plugins'] = serialize($plugins); 
        } 
        return $r; 
    } 
    

    不知道這是故意的惡意。它看起來像一個有針對性的過濾器,但在WP_Upgrader中,所有的參數都丟失了。

  • 相關問題