cURL / Mailing Lists / curl-and-php / Single Mail


SV: cURL can't resolve host through Apache/PHP, works with PHP/CLI

From: Philip Espersen <>
Date: Fri, 7 Sep 2007 00:33:11 +0200

Hi Daniel,

I tried reinstalling c-ares from ports, no good.

My cURL port config (make config) is;

[X] CARES Asynchronous DNS resolution via c-ares
[X] CURL_DEBUG Enable curl diagnostic output
[ ] IPV6 IPv6 support
[X] KERBEROS4 Kerberos 4 authentication
[X] LIBIDN Internationalized Domain Names via libidn
[ ] LIBSSH2 SCP/SFTP support via libssh2
[X] NTLM NTLM authentication
[X] OPENSSL OpenSSL support

None of the above could cause this confligt?


-----Oprindelig meddelelse-----
[] På vegne af Daniel Stenberg
Sendt: 6. september 2007 23:47
Til: curl with PHP
Emne: Re: cURL can't resolve host through Apache/PHP, works with PHP/CLI

On Thu, 6 Sep 2007, Philip Espersen wrote:

> I'm running my own webserver with FreeBSD 6.1, Apache 2.2.4, PHP 5.2.3 and
> cURL, here's info about cURL saxet from phpinfo().
> libcurl/7.16.3 OpenSSL/0.9.7e zlib/1.2.2 c-ares/1.4.0 libidn/0.6.14


> gethostbyname:
> 6Could not resolve host: (Error reading file)

libcurl uses c-ares and not the "plain" gethostbyname() function which
explains how they can end up differently.

Possibly it is a c-ares bug/problem, or possibly there's something that
wants/needs that it can't get/use when run from Apache.

Since it works outside of Apache, I have the gut feeling it is more likely
be something related to how it is invoked within it.

  Commercial curl and libcurl Technical Support:
Jeg beskyttes af den gratis SPAMfighter til privatbrugere.
Den har indtil videre sparet mig for at få 14058 spam-mails.
Betalende brugere får ikke denne besked i deres e-mails.
Hent gratis SPAMfighter her:
Received on 2007-09-07