您的位置:首页 > 运维架构

解决WordPress自动升级超时Operation timed out after 30

2018-02-21 17:05 976 查看
在自动升级WordPress核心以及WordPress插件或主题的时候,比如avada,the7,betheme等国外主题。往往会因为网络原因导致下载核心或插件的时候超时,从而导致升级失败,此时WordPress会给出如下提示:cURL error 28: Operation timed out after 300005 milliseconds with 48782 out of 5279786 bytes received.
Operation timed out after 30 seconds with ......从提示中我们可以看到WordPress默认给出的超时时限是30秒,我们可以将这个值修改的大一些,使得即使在网速不佳的情况下也可以完成下载。打开 wp-admin\includes\file.php查找如下语句
1$response = wp_remote_get($url, array('timeout' => 30));
将其中的30改大,如改成300:
1$response = wp_remote_get
4000
($url, array('timeout' => 300));
保存即可。新版(4.9以上)//Define the timeouts for the connections. Only available after the construct is called to allow for per-transport overriding of the default.
if ( ! defined('FS_CONNECT_TIMEOUT') )
define('FS_CONNECT_TIMEOUT', 30);
if ( ! defined('FS_TIMEOUT') )
define('FS_TIMEOUT', 30);
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: 
相关文章推荐