Re: fopen does not open URL-files
| From: | Taras V. Panchenko | Date: | Sat, 20 Dec 2003 10:15:54 +0000 |
| Subject: | Re: fopen does not open URL-files | ||
| References: | 1 2 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-173070@lists.php.net to get a copy of this message | ||
I tried, but I receive the new error:
Warning: fopen(): php_network_getaddresses: getaddrinfo failed: Name or
service not known in /home/manageme/public_html/try-test/fopen-test-http.php
on line 7
Warning: fopen(http://www.management.kiev.ua/MO/main.php/): failed to open
stream: Permission denied in
/home/manageme/public_html/try-test/fopen-test-http.php on line 7
Why there are errors in this simple command? What are
'php_network_getaddresses' and 'getaddrinfo' ?
Thanx,
Taras V. Panchenko.
"Eric Bolikowski" <eric@broadpark.no> wrote in message
news:20031218182721.71582.qmail@pb1.pair.com...
>
> "Taras Panchenko" <pantaras@unicyb.kiev.ua> wrote in message
> news:20031218100917.22872.qmail@pb1.pair.com...
>
> > I have 2 questions:
> > 1) why gethostbyname() does not resolve my host name into IP?
> > 2) why fopen() (and file()) does not open an external (URL) file via
http?
> > Please, see my example below:
> > ------------------
> >
>
http://www.management.kiev.ua/try-test/fopen-test-http.php
-----------------
> > --
> > <?
> > echo gethostbyname("www.management.kiev.ua");
> >
> >
> > $h=fopen("http://www.management.kiev.ua/MO/main.php",
> > "r");
> > echo fread($h,200);
> > ?>
>
> Try this rather(maybe it works):
>
> <?php
>
>
> $fp=fopen("http://www.management.kiev.ua/MO/main.php/",
> "r");
> echo fread($fp,200);
> ?>