[英]An unexpected error occurred. Something may be wrong with WordPress.org
I was not able to install plugins in my WordPress site.我无法在我的 WordPress 网站中安装插件。
I am getting the following error when i try to install a new plugin.But its allowing me to upload a plugin and then to install it.当我尝试安装新插件时出现以下错误。但它允许我上传插件然后安装它。
"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." “发生意外错误。WordPress.org 或此服务器的配置可能有问题。如果仍有问题,请尝试支持论坛。”
After spending more time is this I have resolved this by looking at在花了更多时间之后,我通过查看解决了这个问题
wp-config.php
Make sure this flag is false, if it's true update couldn't be happen确保这个标志是假的,如果是真的,更新就不会发生
define('WP_HTTP_BLOCK_EXTERNAL', false);
Try to turn SELinux to permissive to see if it was causing the problem.尝试将 SELinux 设置为 permissive,看看是否是它导致了问题。
And to do that open this file:要做到这一点,请打开此文件:
nano /etc/selinux/config Then change the line SELINUX=enforcing to SELINUX=permissive nano /etc/selinux/config 然后将 SELINUX=enforcing 行更改为 SELINUX=permissive
Then reboot:然后重启:
sudo shutdown -r now sudo 关机 -r 现在
this is working on me on centos 8 thank you这是我在centos 8上的工作,谢谢
To debug this set WP_DEBUG to true in wp-config.要调试此设置 WP_DEBUG 在 wp-config 中为 true。
define('WP_DEBUG', true);
In my case this shows a curl error attempting to reach host: api.wordpress.org when loading the add new plugins page.在我的情况下,这显示了在加载添加新插件页面时尝试访问主机的 curl 错误:api.wordpress.org。
On my server curl was already installed correctly.在我的服务器上 curl 已经正确安装。 You can run this command to install it on Ubuntu:
您可以运行此命令在 Ubuntu 上安装它:
sudo apt-get install curl
The solution in my case was to restart Apache.在我的情况下,解决方案是重新启动 Apache。
sudo service apache2 restart
After this the plugin page resolved normally.在此之后,插件页面正常解析。
Set Debug back to false when you confirm everything is working:确认一切正常后,将 Debug 设置回 false:
define('WP_DEBUG', false);
Try to turn SELinux to permissive to see if it was causing the problem.尝试将 SELinux 设置为 permissive,看看是否是它导致了问题。
And to do that open this file:要做到这一点,请打开此文件:
nano /etc/selinux/config
Then change the line SELINUX=enforcing
to SELINUX=permissive
然后将
SELINUX=enforcing
行更改为SELINUX=permissive
Then reboot:然后重启:
sudo shutdown -r now
Steps I would use:我会使用的步骤:
When I have run to that error it has usually been some misconfiguration in my machine, either denying write access or outgoing network access from the web server processes.当我遇到该错误时,通常是我的机器配置错误,拒绝了 Web 服务器进程的写访问或传出网络访问。
What do your PHP and web server logs have?你的 PHP 和 Web 服务器日志有什么? Is the site on localhost or on a production server?
该站点是在本地主机上还是在生产服务器上?
There are few steps that you can look for: 1)make sure you have sufficient space on your domain 2) try uninstalling all the available plugins one by one and check (eg : plugin like WP Video Lightbox causes issue like this sometimes您可以查找几个步骤: 1)确保您的域上有足够的空间 2)尝试一一卸载所有可用插件并检查(例如:像 WP Video Lightbox 这样的插件有时会导致这样的问题
3) Disable all plugins and then reactivating them 4)if you are running wordpress on your virtual machine, try ping test on your server side. 3) 禁用所有插件,然后重新激活它们 4) 如果您在虚拟机上运行 wordpress,请在服务器端尝试 ping 测试。 5) if nothing works try installing new version of wp
5)如果没有任何效果,请尝试安装新版本的 wp
Hope it helps you希望对你有帮助
Thankyou谢谢
My solution :wp-config.php in add code我的解决方案:wp-config.php 中添加代码
define('WP_HTTP_BLOCK_EXTERNAL', false);
Also appeared :还出现了:
enter image description here在此处输入图片说明
An unexpected error occurred.
一个意料之外的问题发生了。 Something may be wrong with WordPress.org or this server's configuration.
WordPress.org 或此服务器的配置可能有问题。 If you continue to have problems, please try the support forums.
如果您仍然遇到问题,请尝试支持论坛。 |Try Again|
|再试一次|
Is there a better solution, looking forward to sharing有没有更好的解决方案,期待分享
I had the same problem on fedora but after searching for a while it seems that SELinux denied permission to make outgoing network connections.我在 Fedora 上遇到了同样的问题,但搜索了一段时间后,似乎 SELinux 拒绝了建立传出网络连接的权限。 You can find evidence of this in /var/log/audit/audit.log.
您可以在 /var/log/audit/audit.log 中找到这方面的证据。 For example: type=AVC msg=audit(1531585576.912:201): avc: denied { name_connect } for pid=802 comm="php-fpm" dest=443 scontext=system_u:system_r:httpd_t:s0 tcontext=system_u:object_r:http_port_t:s0 tclass=tcp_socket permissive=0
例如:type=AVC msg=audit(1531585576.912:201): avc: denied { name_connect } for pid=802 comm="php-fpm" dest=443 scontext=system_u:system_r:httpd_t:s0 tcontext=system_u:object_r: http_port_t:s0 tclass=tcp_socket permissive=0
To resolve the problem:要解决问题:
setsebool -P httpd_can_network_connect 1
Now SELinux will permit WordPress to make outgoing network connections to check for updates.现在 SELinux 将允许 WordPress 建立传出网络连接以检查更新。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.