Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

php5-curl error: couldn't resolve host

1,526 views
Skip to first unread message

Jacob Yocom-Piatt

unread,
May 18, 2006, 6:42:53 PM5/18/06
to
i'm trying to get the php5-curl-5.0.4p0 module working with some php code that's
running on a 3.8-release machine. this code makes XML requests to UPS to get
shipping costs and times. when the php attempts to use curl to contact the UPS
web address https://wwwcie.ups.com:443/ups.app/xml/Rate , it craps out and gives
an error:

Error from cURL: Error [6]: Couldn't resolve host 'wwwcie.ups.com'

i suspect this is an issue with running from inside the apache chroot, but do
not know how to proceed and/or confirm this suspicion. just to be thorough,
here's the chunk of php code that generates the error:

$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);

curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_HEADER, 0);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $xmlRequest);
curl_setopt($ch, CURLOPT_TIMEOUT, (int)$timeout);

if ($this->logfile) {
error_log("UPS REQUEST: " . $xmlRequest . "\n", 3, $this->logfile);
}
$xmlResponse = curl_exec ($ch);
if (curl_errno($ch) && $this->logfile) {
$error_from_curl = sprintf('Error [%d]: %s', curl_errno($ch), curl_error($ch));
error_log("Error from cURL: " . $error_from_curl . "\n", 3, $this->logfile);
}

i presume url = the url i gave above.

any advice appreciated.

cheers,
jake

Spruell, Darren-Perot

unread,
May 18, 2006, 7:00:14 PM5/18/06
to
From: owner...@openbsd.org
> i'm trying to get the php5-curl-5.0.4p0 module working with
> some php code that's
> running on a 3.8-release machine. this code makes XML
> requests to UPS to get
> shipping costs and times. when the php attempts to use curl
> to contact the UPS
> web address https://wwwcie.ups.com:443/ups.app/xml/Rate , it
> craps out and gives
> an error:
>
> Error from cURL: Error [6]: Couldn't resolve host 'wwwcie.ups.com'
>
> i suspect this is an issue with running from inside the
> apache chroot, but do
> not know how to proceed and/or confirm this suspicion.

Do you have etc/resolv.conf in your chroot?

DS

Stuart Henderson

unread,
May 18, 2006, 7:00:48 PM5/18/06
to
On 2006/05/18 17:42, Jacob Yocom-Piatt wrote:
> Error from cURL: Error [6]: Couldn't resolve host 'wwwcie.ups.com'
> i suspect this is an issue with running from inside the apache chroot,

Yes, that's likely. Think how programs on the computer find out
what nameserver to use and this should lead you in the right
direction.

Or run httpd(8) under ktrace(1) (starting httpd in single-process
mode makes this easier) and that should also identify it for you.

Karsten McMinn

unread,
May 18, 2006, 7:18:54 PM5/18/06
to
On 5/18/06, Jacob Yocom-Piatt <di...@uchicago.edu> wrote:
>
> i'm trying to get the php5-curl-5.0.4p0 module working with some php code
> that's
> running on a 3.8-release machine. this code makes XML requests to UPS to
> get
> shipping costs and times. when the php attempts to use curl to contact the
> UPS
> web address https://wwwcie.ups.com:443/ups.app/xml/Rate , it craps out and
> gives
> an error:


search. read.

http://www.openbsd.org/faq/faq10.html#httpdchroot

http://www.php.net/manual/en/function.gethostbyname.php

Jacob Yocom-Piatt

unread,
May 18, 2006, 9:08:34 PM5/18/06
to

thanks to all who gave me the resolv.conf suggestion both on and off list. i
should've figured that out since i did see the failure had to do with
gethostbyname(), <doh!>. all is working now, and if this goes well it will mean
i can donate some $$ to the project.

avalo...@gmail.com

unread,
Feb 8, 2014, 5:06:24 AM2/8/14
to
the resolv.conf problem fixed it for me. Thank you
0 new messages