问题
I was not able to install plugins in my WordPress site.
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."
回答1:
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);
回答2:
Try to turn SELinux to permissive to see if it was causing the problem.
And to do that open this file:
nano /etc/selinux/config Then change the line SELINUX=enforcing to SELINUX=permissive
Then reboot:
sudo shutdown -r now
this is working on me on centos 8 thank you
回答3:
To debug this set WP_DEBUG to true in wp-config.
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.
On my server curl was already installed correctly. You can run this command to install it on Ubuntu:
sudo apt-get install curl
The solution in my case was to restart Apache.
sudo service apache2 restart
After this the plugin page resolved normally.
Set Debug back to false when you confirm everything is working:
define('WP_DEBUG', false);
回答4:
Steps I would use:
- Validate that the filesystem allows WordPress to write to the WordPress directories.
- Validate that you have allowed outgoing traffic in your web server, firewall and internal network.
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.
What do your PHP and web server logs have? Is the site on localhost or on a production server?
回答5:
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
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. 5) if nothing works try installing new version of wp
Hope it helps you
Thankyou
回答6:
Try to turn SELinux to permissive to see if it was causing the problem.
And to do that open this file:
nano /etc/selinux/config
Then change the line SELINUX=enforcing
to SELINUX=permissive
Then reboot:
sudo shutdown -r now
回答7:
My solution :wp-config.php in add code
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. If you continue to have problems, please try the support forums. |Try Again|
Is there a better solution, looking forward to sharing
来源:https://stackoverflow.com/questions/32879475/an-unexpected-error-occurred-something-may-be-wrong-with-wordpress-org