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

curl-and-php

RE: Domain resolution problem

From: Dan Brown <dbrown_at_attbi.com>
Date: Wed, 13 Feb 2002 17:10:35 -0800

David,

As new as I am to PHP & cURL, I probably shouldn't be trying to help yet :-)
I will share my experience with you in hopes that it helps though. This is
my own experience... The information may not be 100% technically correct.
But I hope it'll at least force someone else to jump in as no one seems to
reply here.. :/

I installed Curl 7.9.x on my Mandrake 8.1 Linux system with OpenSSL 0.9.6,
Apache 1.3.something and a version of PHP that was 4.0.6 or older. I was
running into a problem of cURL not working. So I got a friend from work to
come over , as he's awesome with Linux. We discovered that cURL ran fine
from the shell, but wouldn't accept commands from the browser. It seems that
Libcurl was required, as this provides PHP the functions it needs to init
cURL. Not only that, but we also discovered that PHP 4.0.x seems to have
problems executing programs on the server. One of our work servers had this
problem I'm told as well. At first they wrote a patch to get around it, in
the long run they ended up installing PHP 4.1.0 (They're up to 4.1.1 now?)
as it fixes this issue. (or so I'm told...)

I hope this bit of non-specific information helps!

-Dan

-----Original Message-----
From: curl-and-php-admin_at_lists.sourceforge.net
[mailto:curl-and-php-admin_at_lists.sourceforge.net]On Behalf Of David
Johns
Sent: Tuesday, February 12, 2002 3:41 PM
To: curl and php list
Subject: Domain resolution problem

Hello,

I've just installed curl 7.9.3 on my RedHat Linux system (Kernel 2.2.19),
with OpenSSL 0.9.6c, PHP 4.0.6 and Apache 1.3.23. All seemed to
compile fine - PHP reported curl installed happily and a brief test seemed
to work ok.

However, now I've written a proper bit of code to use it (under libcurl in
PHP) I'm getting domain resolution problems - it refuses to resolve
https://www.paypal.com (although it seems to have no trouble getting the
page on the command line version of curl).

So I did a search through the archives and I see that this one has come up
before but being a novice at all this I'm a bit baffled as to the fix.
Below are some config bits that seemed to crop up in the archive which may
be relevant - can anyone suggest what's wrong and how to fix
it, bearing in mind I'm no expert at compiling or C or suchlike (I just
follow the instructions and hope for the best...)?

$ cat config.log | grep gethostbyname_r
configure:10439: checking for gethostbyname_r
configure:10502: checking if gethostbyname_r takes 3 arguments
configure:10514: conflicting types for `gethostbyname_r'
/usr/include/netdb.h:161: previous declaration of `gethostbyname_r'
gethostbyname_r(const char *, struct hostent *, struct hostent_data *);
gethostbyname_r(NULL, NULL, NULL);
configure:10551: checking if gethostbyname_r with -D_REENTRANT takes 3
arguments

configure:10565: conflicting types for `gethostbyname_r'
/usr/include/netdb.h:161: previous declaration of `gethostbyname_r'
gethostbyname_r(const char *,struct hostent *, struct hostent_data *);
gethostbyname_r(NULL, NULL, NULL);
configure:10606: checking if gethostbyname_r takes 5 arguments
configure:10617: conflicting types for `gethostbyname_r'
/usr/include/netdb.h:161: previous declaration of `gethostbyname_r'
gethostbyname_r(const char *, struct hostent *, char *, int, int *);
gethostbyname_r(NULL, NULL, NULL, 0, NULL);
configure:10654: checking if gethostbyname_r takes 6 arguments
ac_cv_func_gethostbyname_r=yes

$ grep HOSTBY config.h
/* #undef HAVE_GETHOSTBYADDR_R_5 */
/* #undef HAVE_GETHOSTBYADDR_R_7 */
#define HAVE_GETHOSTBYADDR_R_8 1
/* #undef HAVE_GETHOSTBYNAME_R_3 */
/* #undef HAVE_GETHOSTBYNAME_R_5 */
#define HAVE_GETHOSTBYNAME_R_6 1
#define HAVE_GETHOSTBYADDR 1
#define HAVE_GETHOSTBYADDR_R 1
#define HAVE_GETHOSTBYNAME_R 1

Many thanks,

David Johns
culturejam.tv - video and audio optimised for the web
Nudity! Violence! And a microbilling pay-per-view solution!
See it all at http://www.salmondays.tv

e: djohns_at_culturejam.tv
t: +44 (0) 20 8979 7600
f: +44 (0) 20 8979 8140

This message is intended only for the use of the person(s) (the "intended
recipient(s)") to whom it is addressed. It may contain information which is
privileged and confidential. If you are not the intended recipient, please
contact the sender as soon as possible. The views expressed in this
communication may not necessarily be the views of Culturejam TV. Any
copyright in this message shall remain vested in Culturejam TV and the
intended recipient may only copy the same for internal business purposes or
as otherwise stated in this message. culturejam limited registered number
04147310
Received on 2002-02-14