News & Info

CSA Daily Updates and Tech Chatter

HTTP Errors When Uploading/Connecting in WordPress

Having problems browsing themes, uploading plug-ins, or doing just about anything that “talks” to the outside world via WordPress? We have had a development server buried deep in our network behind several routers and firewalls that had a similar problem. Whenever we’d log into the dashboard we’d get various timeout error messages on each of the news sections. We’d not get our automatic update messages whenever there was a plugin update or a WordPress update (3.0 is coming soon!).
Well it turns out that we needed to fix 2 things to help speed up the network connection.

Fix #1 – DNS Resolution

We run this particular development box on Linux.   That meant updating our /etc/resolv.conf file to talk directly to the DNS servers. If you use DHCP configuration or go through a router this file is often empty.   Force-feeding our Internet Service Providers (ISPs) DNS server IP addresses into this file sped up domain name lookups significantly.  This meant looking up things on wordpress.org took 1-2 seconds versus the previous 10-20 second lookup times.   Here is what we put in our file for our Bellsouth/AT&T DNS in Charleston South Carolina:

search cybersprocket.com
nameserver 205.152.37.23
nameserver 205.152.132.23
nameserver 192.168.3.254

Fix # 2 – Adjust PHP Timeout

This seemed to help with the problem, though we’re not sure why.  WordPress should be overriding the default PHP.ini settings but maybe something was missed deep in the bowels of the WordPress codebase… either that or this was pure coincidence.  Either way, we’re listing it here because as soon as we did these two things our timeout issues went away.

Update php.ini, on our linux server this is /etc/php.ini, and change the default_socket_timeout setting to 120.  That section of our php.ini now looks like this:

; Default timeout for socket based streams (seconds)
;default_socket_timeout = 60
default_socket_timeout = 120

Hopefully these notes will help you resolve any timeout issues you’re having with your WordPress site.

Tags: , , , ,

About Lance Cleveland

I started my high-tech career in the early 80's as a computer technician. I became a lead engineer at a Boston area database company a few years later. When the Internet was just starting to show up on people's radar I quit my corner-office job and founded ProActive Web Marketing, my first start up company. That was the genesis of several successful start up companies including Time Magazine award winner The Lobster Net. After brief retirement in my mid-30s I co-founded the software consulting firm, Cyber Sprocket Labs. In addition to being "man of all hats" at Charleston Software Associates, I currently serve on the board or as technical adviser for several companies including Musiplicity, Model Locate, and Advanced Media Ltd. In the past I consulted for Data General, Kimberly Clark, Kraft, Philip Morris, Rich Foods, Telefonica, Aribtron, and a half-dozen other Fortune 500 companies. I've appeared as a keynote speaker for the USVI Economic Development Summit, showed up as a lead interviewee for Microsoft infomercials, and have been a cited performance advertising, Internet retail, and cybercrime expert in The Wall Street Journal and New York Times. I currently spend most of my time hanging with friends & family while hacking WordPress plugins. ### Code geek. Dad. Husband. Rum Lover. Not necessarily in that order.

Socialize

Enter your email below to sign up for the monthly Store Locator Plus newsletter. Click the Facebook icon to get almost-daily updates on what I'm working on now. The RSS feed icon will bring my bi-weekly blog posts to your feed reader.

Comments are closed.