Discussion:
[PHP] About Get_meta_tags()
(too old to reply)
Jimmie
2005-08-08 09:32:40 UTC
Permalink
------=_NextPart_000_0012_01C59C3C.1C4F7F70
Content-Type: text/plain;
charset="us-ascii"
Content-Transfer-Encoding: 7bit

Hi, All,

Sorry to trouble you, but I really can not handle this problem now. I
want to call get_meta_tags() function to get meta-tags which site I want to
know. I searched usage and I did like this:

<?php

// Call get_meta_tags to fetch meta_tags in brackets.

$tags = get_meta_tags("http://www.example.com/");



//Echo meta content

print $tags['keywords'];

?>



But an errors occurred when the page run. Some information liked this:

Warning: get_meta_tags(): php_network_getaddresses: gethostbyname failed
in d:\apache\htdocs\meta_tag.php on line 3

Warning: get_meta_tags(http://www.pconline.com.cn): failed to open stream:
No such file or directory in d:\apache\htdocs\meta_tag.php on line 3



My server is Apache 1.3.27 and PHP4.4.0 that run in Windows 2000 server.



I want to ask if anybody can solve the problem, thanks so much.



Best wishes,

Jimmie




------=_NextPart_000_0012_01C59C3C.1C4F7F70--
Paul Waring
2005-08-08 09:49:51 UTC
Permalink
Post by Jimmie
Warning: get_meta_tags(): php_network_getaddresses: gethostbyname failed
in d:\apache\htdocs\meta_tag.php on line 3
No such file or directory in d:\apache\htdocs\meta_tag.php on line 3
The first error means that PHP can't resolve the domain name
pconline.com.cn, i.e. it doesn't know what IP address that site is
hosted on. As a result, it can't connect to the site and open a file
stream to read the page you want to get the meta tags for, which is what
the second error is about. I would suggest getting up a command prompt
on the machine you are using (if this is possible) and seeing if you can
resolve the domain manually by running 'nslookup pconline.com.cn'
(without the quotes). If you can't, then there's almost certain a
problem with one of your DNS resolvers, as I can resolve the hostname
from here.

Paul
--
Rogue Tory
http://www.roguetory.org.uk
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
Jasper Bryant-Greene
2005-08-08 21:14:58 UTC
Permalink
Post by Jimmie
Warning: get_meta_tags(): php_network_getaddresses: gethostbyname
failed in d:\apache\htdocs\meta_tag.php on line 3
Looks like your DNS is failing or that host does not have a DNS record.

Have you tried going to that URL in a browser on the same machine the
PHP script is running on?

Jasper
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
Continue reading on narkive:
Loading...