Support » Fixing WordPress » php as CGI Download failed.: Couldn’t resolve host ‘’

  • Resolved jazzylee77


    I get the following type error when attempting to automatically update plugins. The host is running php as CGI.

    Upgrade Plugin
    Downloading update from
    Download failed.: Couldn't resolve host ''
    Plugin upgrade Failed
Viewing 15 replies - 1 through 15 (of 15 total)
  • Moderator Samuel Wood (Otto)

    (@otto42) Admin

    Your host doesn’t have DNS set up correctly, so it can’t figure out where is. Talk to your host, get them to fix the server.

    The host’s tech support says

    I have checked DNS servers and they are set correctly for your domain name so the issue must be related to some PHP functions that try to connect. Could you please turn to the developer to know what PHP functions should be used in it to connect to their site?

    What a cheek! Tech’ support, pshh!

    When you click on that link from within WP (the error message) does the zip file download start for you (as if you were saving it to your PC for a manual upgrade)?

    I click the “Upgrade Automatically” link from the plugins page.

    Then this comes up in wordpress.

    Upgrade Plugin

    Downloading update from

    Download failed.: Couldn’t resolve host ‘’

    Plugin upgrade Failed

    No download dialog window from firefox or windows.

    Oh, might have misunderstood. The link in the error message is just text – not active.

    Moderator Samuel Wood (Otto)

    (@otto42) Admin

    The host’s tech support says

    I have checked DNS servers and they are set correctly for your domain name

    Tell them that they checked the wrong thing. This has nothing to do with your domain name at all, nor anything to do with the DNS servers.

    It has to do with the DNS configuration on your web server. Tell them that your web server is trying to make an outgoing connection to the internet, and the DNS on your web server is NOT configured correctly, so it can’t resolve the IP of

    Tell them to try to telnet or ssh to your web server, and then ping the outside world from there. They won’t be able to do it, because name resolution is not setup properly.

    The issue is NOT related to PHP. It’s related to the fact that their server can’t figure out the IP address given the host name of the site it’s trying to connect to.

    And if they still can’t fix it, tell them that you’re canceling your service and moving to a host that knows WTF they’re doing.

    More passing the buck from the host.

    In order to override the problem you can try addressing directly to IP address instead of domain name: has addresses and

    This connection will not need DNS propagation. Should you have any other questions or concerns regarding this, please feel free to contact us.

    Moderator Samuel Wood (Otto)

    (@otto42) Admin

    That’s not an option, because the IP is variable and may change from time to time. Also, it won’t work with any web servers that use virtual hosts (which is virtually all of them nowadays), and is one of those types of servers. You may notice that this URL doesn’t work:

    DNS setup on a web server is not optional. So my advice is to switch to a new hosting service, since these guys obviously have no idea what they are doing.

    Also, you might do everybody else a favor and tell what the hosting companies name is, so we can all avoid them in the future.

    Well, they told me to check out reverse trace route in control panel and it does connect to alright. They suggest “Please check it from your side and then check the code of your applications”

    It’s not only wordpress that gives me this “Couldn’t resolve host” error. Also for popshops script using php code.

    traceroute: Warning: has multiple addresses; using

    traceroute to (, 30 hops max, 38 byte packets

    1 gw ( 0.467 ms 0.428 ms 0.422 ms

    2 ( 0.449 ms 0.280 ms 0.261 ms

    3 ( 13.337 ms 13.174 ms 13.190 ms

    4 ( 13.343 ms 13.332 ms 13.306 ms

    5 ( 17.011 ms 17.066 ms 16.654 ms

    6 ( 27.496 ms 27.477 ms 27.346 ms

    7 ( 38.248 ms 38.556 ms 38.807 ms

    8 ( 40.515 ms 40.325 ms 40.261 ms

    9 ( 40.086 ms 39.943 ms 40.026 ms

    10 ( 40.081 ms 40.140 ms 40.072 ms

    11 ( 40.406 ms 40.736 ms 40.377 ms

    12 ( 40.216 ms 40.295 ms 40.323 ms

    I’m looking at the phpinfo page and can’t see anything, but I don’t really know what I’m looking for.

    I’ve been planning on moving remaining sites from the host. for quite a while. But I know it will be a big chore with odd settings galore, mysql is a separate server that in the past has bogged down with traffic, path to perl is odd…many other quirks I’ve forgotten.

    I’m having the same problem with Lunarpages. Ever since they move their servers from LA to San Diego a couple weeks ago, 2.7 can’t download/.upgrade the plugings. They did lots of upgrades too (php, apache, etc.)

    I am also using gmail lite, which is a php app/middleman where I can check my gmail account from. I use this because my work blocks gmail and other major webmail places (grr) But the glite also give me a similar “Can’t connect” error.

    Before they did the move and migration, wordpress 2.7 and glite worked fine. The plugins downloaded and installed, and I was able to view gmail email through glite.

    So out of curiosity, I found a php script which will “wget” a file and copy it to the folder it’s in. So I had it get one of the wordpress plugings. Well, it worked.

    Here’s the code: (just copy it to test.php and pop in in a test folder on your site. Then run the script… It’ll then download the plugin to that folder.

    $foo = system('wget ~',$output);

    So it appears like my web server can resolve the DNS since it got the file.

    I’m kind of stuck… but I’m wondering if there is something that would affect this “connection problem” in any of these files.
    .htaccess, php.ini (apache and php config files)

    I looked through the settings and didn’t see anything that caught my eye.

    I do have wordpress 2.7 running on this computer I’m typing on now… and it works ok. So I don’t think it’s a bug in the wordpress software itself.

    I created another test php file (test2.php) with this code”
    <?php phpinfo(); ?>

    It pulls up a ton of debugging info. Does anyone know of any PHP settings that may cause the problem?

    Maybe your situation is different than mine. But my fix came server side related to DNS. They argued that it wasn’t the problem since you could run a reverse trace from control panel. But for reasons beyond my current knowledge, that was irrelevant. I can only guess that in certain instances, the DNS wasn’t working.

    I’m sure this comes as no surprise to Otto42, but he was absolutely right. I kept insisting to support that it had nothing to do with PHP, but not having their DNS setup properly. I reminded them that wordpress is maybe the most commonly used script out there and it should be able to run on their server as it does anywhere else I have tried.

    I still don’t know exactly what they changed. But they found something in the server setup and now everything works.

    Other scripts that used offsite urls for php did not work before the fix. I noticed this in a couple store-builder scripts.

    It was worth nagging them patiently for a couple weeks, since moving those sites was going to be a real headache…

    And a big thanks to Otto42 for being so adamant in his opinion, giving me the confidence to keep pushing for a server side solution.

    Just to add my 2 cents. I was having the same problem with my Lunarpages-based WordPress blogs — plugin automatic upgrades were failing because of DNS issues with the server I was on.

    I opened a ticket and it took about four exchanges with support over 2 days before it finally got to the right person, and they quickly fixed the problem.

    As jazzylee77 said, it pays to be politely persistent. One of the support staff replied to my bug report telling me that since I can upgrade plugins manually it wasn’t their problem to fix. I politely explained (again) why it was a server issue and needed to be fixed, and this time the gatekeepers let the bug report through.

    Considering I am only paying $5/month for my shared server account (which is running three active blogs and a couple more in the near future) I am realistic about the level of support I will get from Lunarpages. Having said that, I have always found them to be very responsive (sometimes after a little persistence) and they have fixed all the issues I have reported to them — even one which took a fair amount of time and debugging on their behalf.

    They don’t always get it right first time of asking, but in the end I am very happy with their support over the last year.

    since this is not resolved .. maybe you can try adjusting .htaccess file .. to enable the mod rewrite features if your host is apache.

    btw this is what i found

    # BEGIN WordPress
    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /index.php [L]
    # END WordPress

    and this is the result and i had no issues with the DNS resolv, since i do my own server

    Downloading update from

    Unpacking the update

    Deactivating the plugin

    Removing the old version of the plugin

    Installing the latest version

    Plugin upgraded successfully

    Attempting reactivation of the plugin

    good luck

    i have the same problem 🙁
    DNS works fine (ping, nslookup, …)
    but in wordpress : “Falhou o download. Couldn’t resolve host ‘'”

Viewing 15 replies - 1 through 15 (of 15 total)
  • The topic ‘php as CGI Download failed.: Couldn’t resolve host ‘’’ is closed to new replies.