Re: gethostbyname failing?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thursday 09 November 2006 15:56, Jürgen Wind <jwind@xxxxxx> sent a missive 
stating: 
> Henrik Hudson wrote:
> > Hey List-
> >
> > running: apache 2.2, freebsd 6.2 and php 4.4.4
> >
> > I've got a wierd issue. I've got a script that does this:
> >
> > $domain = "www.google.com";
> > $ip = gethostbyname($domain);
> > echo $ip;
> >
> > $hostname = gethostbyaddr("72.14.205.99");
> > echo $hostname;
> >
> >
> > Using dig, ping, etc... to confirm name resolution is working works fine.
> > Running that script from the CLI is fine (ie: php test.php). However,
> > when running from the web it doesn't work.
> >
> > I tried it on a php 5.1.x box and it works fine there.
> >
> > Thoughts?
> >
> >
> > Henrik
>
> <?php echo '<pre>';
> print_r( gethostbynamel('www.google.com') );
> ?>
> Array
> (
>     [0] => 209.85.135.103
>     [1] => 209.85.135.104
>     [2] => 209.85.135.147
>     [3] => 209.85.135.99
> )

Yes, I get nothing when running inside Apache. I get no errors in my logs 
either. However, again when I do it from the CLI I get:

<pre>Array
(
    [0] => 72.14.205.99
    [1] => 72.14.205.104
)

So, is this a bug in the php module? a setting in Apache? a setting in my 
php.ini?  or ???

I also tried a perl script which works fine both from the CLI and inside 
Apache.

Henrik
-- 
Henrik Hudson
lists@xxxxxxxxxxx
------------------------------
"God, root, what is difference?" Pitr; UF (http://www.userfriendly.org/)

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux