Re: warning php_hostconnect: connect failed
| From: | Jani Taskinen | Date: | Fri, 22 Jun 2001 16:44:08 +0000 |
| Subject: | Re: warning php_hostconnect: connect failed | ||
| References: | 1 | Groups: | php.install |
| Request: | Send a blank email to php-install+get-3314@lists.php.net to get a copy of this message | ||
There is no support for redirected urls yet.
Use the 'direct' url instead:
$fcontents = file ('http://www.php.net/');
That works. (note the trailing / ?)
--Jani
On Fri, 22 Jun 2001, Joris Van Droogenbroeck wrote:
>Hi,
>
>I'm trying to read some webpage in a file.
>I've got some code from de php.net website:
>
><?php
>// get a web page into an array and print it out
>$fcontents = file ('http://www.php.net');
>while (list ($line_num, $line) = each ($fcontents)) {
> echo "<b>Line $line_num:</b> " . htmlspecialchars ($line) .
> "<br>\n";
>}
>// get a web page into a string
>$fcontents = join ('', file
>('http://www.php.net'));
>?>
>
>When I'm trying to run this code I get the following errors:
>
>Warning: php_hostconnect: connect failed in C:\Program Files\Apache
>Group\Apache\htdocs/source/screener.php on line 17
>
>Warning: file("http://www.php.net") - Bad file
>descriptor in C:\Program
>Files\Apache Group\Apache\htdocs/source/screener.php on line 17
>
>Fatal error: Maximum execution time of 30 seconds exceeded in C:\Program
>Files\Apache Group\Apache\htdocs/source/screener.php on line 17
>
>
>
>What does this mean? Is it a configuration problem?
>When I try this code with some local file it works very well.
>I'm a windows user.
>
>
>
>
>
>
>
>