I have bought a vps and I new to VPS. I have installed a wordpress blog and whenever I go to install a new plugin or try to update a plugin it shows following error. An Unexpected HTTP Error occurred during the API request.
Can anybody help me to resolve this error???
you can do that by increasing the time limit to a higher value. To increase the timeout limit of requests, go to the ‘wp-includes’ folder of your wordpress installation and edit http.php file over there. Here is the screenshot of the piece of code where you need to make the changes.
We have attached below the before and after changes in http.php file to avoid this error message.
Since we have increased the time limit from 5 seconds to 30 seconds, now you will not get this error message in your admin panel. You may increase this timeout value with any amount as per your choice. As I told you that this error message is appearing because the page request is crossing the time limit. It may happens because of plugins used in your WordPress. If you are using lot many plugins which are not properly optimized, you may get this error. Go thru the wordpress optimization technique post to optimize your wordpress set to make your wordpress setup a bit lighter.
Update: In newer versions of WordPress, you will find the above code in class-http.php file in ‘wp-includes‘ folder of your WordPress installation.