安装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中,果然好了

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

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

  1. WordPress安装插件提示输入FTP账户信息

    在WP后台安装插件时提示输入FTP账户信息,其实出现这个的问题的原因是Apache/Nginx的执行身份非文件属主身份. 如果你使用的是独立服务器或VPS,WordPress的安装目录为 /home/ ...

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

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

  3. [转]wordpress安装插件的3种方式

    WordPress插件安装方法有几种?WordPress是一种使用PHP语言开发的博客平台,有些用户不知道怎么安装WordPress插件和主题的,所以今天小编就为大家介绍几种WordPress插件安装 ...

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

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

  5. windows live writer 尝试登陆时发生意外错误,导致无法发表博客解决方案

    刚用windows live writer发表博客, 但是出现如下提示: 尝试登陆时发生意外错误: 网络连接错误--尝试连接到一下日志时出错: http://www.cnblogs.com//xxxx ...

  6. ORA-39127: 调用 "WMSYS"."LT_EXPORT_PKG"."SCHEMA_INFO_EXP" 时发生意外错误

    expdp 告警提示: Export: Release 11.2.0.4.0 - Production on 星期日 4月 28 12:14:51 2019....ORA-39127: 调用 &quo ...

  7. C# HttpRequest基础连接已经关闭: 接收时发生意外错误

    在c#中使用HttpWebRequest时,频繁请求一个网址时,过段时间就会出现“基础连接已经关闭: 接收时发生意外错误”的错误提示. 将webRequest的属性设置成下面的,经测试可以解决. we ...

  8. WordPress 安装插件导致 HTTP 500 内部服务器错误的问题

      春节这几天忙着过节,一直没有看网站,今天登陆上来看到插件有更新,点开更新后,悲剧发生了.页面就无法加载,出现错误无法加载了,着实让我慌了慌(想到重来就郁闷) Chrome:该网页无法正常工作www ...

  9. npm安装插件提示

    现在使用node的人群越来越多,咱也不能落后,得跟紧脚步才行. 今天使用 npm 安装插件的时候,出现以下提示,而且,安装程序看着好像终止了.而且,看到一个exit单词,就认为说安装出错了. $ np ...

随机推荐

  1. Yii框架2.0 数据库操作初接触

    Yii2.0和Yii1.1版本的变动还是挺多的,我发现配置文件有许多不同,Yii1.1版本里有个main.php 好多信息是在这里配置的,比如默认控制器,数据库连接信息:Yii的数据库配置被单独拿出来 ...

  2. 病毒侵袭持续中---hdu3065(AC自动机模板)

    题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=3065 模板题,没什么好说的... #include<stdio.h> #include&l ...

  3. ubuntu14下创建软件的快捷启动方式

    下载软件,使用softname/bin/softname.sh即可启动,但是很麻烦,每次都要打开terminal 为了方便,我们需要创建desktop文件指向这个启动软件的shell文件(以创建Pyc ...

  4. sql server中使用xp_cmdshell

    关键词:sql server开启高级配置,使用Bat,cmdshell 1.sql server中使用xp_cmdshell --允许配置高级选项 GO RECONFIGURE GO . --开启xp ...

  5. django+celery 实现定时任务

    利用 celery 实现定时任务 celery支持定时任务,设定好任务的执行时间,celery就会定时自动帮你执行, 这个定时任务模块叫celery beat Celery安装 由于celery 4. ...

  6. macOS Sierra上ssh免密码登录linux服务器

    1.生成私钥文件 在客户端终端下输入以下命令 ssh-keygen -t rsa 每次执行 ssh-keygen -t rsa 产生的私钥文件都会不同 如果文件"~/.ssh/id_rsa& ...

  7. java static成员变量方法和非static成员变量方法的区别 ( 二 )

    原创文章,未经作者允许,禁止转载!!! 静态成员变量不用new对象,在类加载的过程中就已经初始化存放在数据区域,静态成员变量是类和所有对象共有的,类和对象都可以改变它的值,每一次改变值之后,静态成员变 ...

  8. import MySQLdb 与 import mysql 有什么区别?

    MySQLdb 只支持Python 2.* ,暂时还不支持3.* 可以用PyMySQL 代替,把__init__.py 中添加俩行: import pymysql pymysql.install_as ...

  9. python全栈开发从入门到放弃之初识面向对象

    面向过程 VS 面向对象 面向过程的程序设计的核心是过程(流水线式思维),过程即解决问题的步骤,面向过程的设计就好比精心设计好一条流水线,考虑周全什么时候处理什么东西. 优点是:极大的降低了写程序的复 ...

  10. fork和multiprocessing

    多任务理解 单核cpu完成多个cpu的切换 时间片轮转 优先级调度 并发看上去一起执行 并行一起执行 调度算法 什么样的情况下用什么样的规则让谁去执行. 一般情况下电脑都是并发的 进程的创建-fork ...