安装wordpress插件,提示报错“wordpress发生意外错误,可能WordPress.org或服务器配置文件存在问题”

出问题的页面是http://*.*.*.*/wp-admin/update.php?action=install-plugin&plugin=bbpress&_wpnonce=39e9668a43

查看/wp-admin/update.php这个文件,处理action=install-plugin这个get请求的代码如下

} elseif ( 'install-plugin' == $action ) {if ( ! current_user_can('install_plugins') )wp_die( __( 'You do not have sufficient permissions to install plugins on this site.' ) );include_once( ABSPATH . 'wp-admin/includes/plugin-install.php' ); //for plugins_api..
check_admin_referer( 'install-plugin_' . $plugin );$api = plugins_api( 'plugin_information', array('slug' => $plugin,'fields' => array('short_description' => false,'sections' => false,'requires' => false,'rating' => false,'ratings' => false,'downloaded' => false,'last_updated' => false,'added' => false,'tags' => false,'compatibility' => false,'homepage' => false,'donate_link' => false,),) );

继续查看wp-admin/includes/plugin-install.php的plugins_api方法:

if ( false === $res ) {$url = $http_url = 'http://api.wordpress.org/plugins/info/1.0/';if ( $ssl = wp_http_supports( array( 'ssl' ) ) )$url = set_url_scheme( $url, 'https' );$http_args = array('timeout' => 15,'body' => array('action' => $action,'request' => serialize( $args )));$request = wp_remote_post( $url, $http_args );if ( $ssl && is_wp_error( $request ) ) {trigger_error( __( '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 <a href="https://wordpress.org/support/">support forums</a>.' ) . ' ' . __( '(WordPress could not establish a secure connection to WordPress.org. Please contact your server administrator.)' ), headers_sent() || WP_DEBUG ? E_USER_WARNING : E_USER_NOTICE );$request = wp_remote_post( $http_url, $http_args );}if ( is_wp_error($request) ) {print_r($request->error_data);echo $request->errors;$res = new WP_Error('plugins_api_failed', __( '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 <a href="https://wordpress.org/support/">support forums</a>.' ), $request->get_error_message() );} else {$res = maybe_unserialize( wp_remote_retrieve_body( $request ) );if ( ! is_object( $res ) && ! is_array( $res ) )$res = new WP_Error('plugins_api_failed', __( '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 <a href="https://wordpress.org/support/">support forums</a>.' ), wp_remote_retrieve_body( $request ) );}

经过了一下午的挣扎,然后想,访问wordpress的时候一直比较慢,是不是连接超时了呢?

在ping.chinaz.com上ping api.wordpress.com,找了一个比较快的ip地址66.155.40.186,配置到/etc/host中,果然好了

祝病魔早日战胜方校长!!!!!!

转载于:https://www.cnblogs.com/wuxie1989/p/5773800.html

wordpress安装插件提示“wordpress发生意外错误,可能WordPress.org或服务器配置文件存在问题”...相关推荐

  1. WordPress安装插件提示:发生了预料之外的错误。

    WordPress安装插件提示:发生了预料之外的错误.WordPress.org或是此服务器的配置可能出了一些问题. 最近换了个服务器,安装好WordPress之后,在给美业网准备导入测试数据,需要在 ...

  2. wordpress安装插件提示需要ftp账号和密码解决

    在wordpress安装之后,想要安装一个插件来用,结果提示输入ftp账户与密码,而我本人根本不记得什么时候设置过ftp账户与密码.最后搜索了一下网上的解决方案,所需要更改wordpress文件夹的权 ...

  3. Yosimite 系统 “发生意外错误(错误代码-50)” (记一次macbook pro(mid2012) 自主维修排错经历)...

    电脑型号: Macbook Pro(Mid 2012)   A1278 问题描述: 上周,电脑偶尔弹出提示框"发生意外错误(错误代码-50)",弹出这个提示之后硬盘好像变成只读模式 ...

  4. 解决Openwrt安装插件提示一下错误的办法

    解决Openwrt安装插件提示一下错误的办法 Openwrt安装17ce插件,提示一下错误: Collected errors: * check_data_file_clashes: Package ...

  5. Discuz!教程之应用中心安装插件提示“数据下载错误(105)”的解决办法

    近期很多用户在应用中心安装应用,提示105错误,大部分是阿里云的服务器,PHP 5.3.28.PHP5.3.29等. 通过常规的方法排查后,仍然不能解决问题,官方给出的说明是PHP问题,升级PHP即可 ...

  6. C#使用request.GetRequestStream() 提示“底层连接已关闭:发送时发生意外错误”的问题

    在使用HttpWebRequest的实例request请求网址时,在调用request.GetRequestStream()时提示 "底层连接已关闭:发送时发生意外错误"的问题 论 ...

  7. HttpWebRequest 提示 “基础连接已关闭:发送时发生意外错误” 的解决方法

    HttpWebRequest 多次请求不同网站时,由于安全协议问题.提示错误 "The underlying connection was closed: An unexpected err ...

  8. Wordpress安装插件失败

    Wordpress安装插件失败,可能是由于没有设置PHP环境变量 解决: 1.添加PHP的系统环境变量,设置php.exe所在路径,如下图是windows 10的设置环境: 打开命令行,执行php - ...

  9. 运行windows live writer时发生“意外错误”

    安装完成后按照介绍的配置方法,提示 "尝试检测日志设置时发生意外错误 QI for IEnumVARIANT failed on the unmanaged server",goo ...

最新文章

  1. mysql导入Excel数据
  2. react native 导入组件
  3. mysql配置参数调优(8GB内存和64GB内存)
  4. 号外号外!自动化测试工具AutoRunner V4.2 新版本升级预告!
  5. 使用plsql developer 创建用户
  6. java动态打印_JFreeChart学习(三)——动态打印java内存使用情况
  7. 科学计算机看电量,解密:关于手机电量为1%是如何科学的算出来的?
  8. 前端学习(2116):为什么组件data必须是函数
  9. mac下解决mysql乱码问题
  10. 线性拟合——从最大似然估计到平方误差到huber loss
  11. 密封槽设计标准_密封槽设计标准
  12. DllRegisterServer调用失败
  13. android 增加定时开关机
  14. 【前沿技术了解】-- 云原生技术与架构
  15. Azkaban安装并设置定时任务Schedule以及邮件发送接收
  16. Spring中循环依赖详解
  17. buflab-计算机系统实验
  18. Ubuntu软件安装与卸载
  19. 计算机考研C语言基础
  20. 中国人寿保险软件开发机试题 java实现

热门文章

  1. 黑马程序员--SpringBoot---基础篇
  2. matplotlib之pyplot模块——绘制误差棒图 errorbar()
  3. sudo漏洞修复升级
  4. 在2012年08月08号这一天,2345浏览器的V2.0版本跑出来了!
  5. Manifest和Repo使用详解
  6. 2021 西湖论剑 pwn blind
  7. 基于 PaddleClas 的 SoccerNet 足球 ReID 基线
  8. 数组c语言抓小偷,警察抓小偷C语言源码
  9. 数据库MySQL的使用,带GUI界面
  10. 实验9、键盘扫描及数码管显示实验