RE: [PHP] fopen and http://
| From: | Warren Vail | Date: | Thu, 24 Feb 2005 16:07:42 +0000 |
| Subject: | RE: [PHP] fopen and http:// | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-209363@lists.php.net to get a copy of this message | ||
Just a wild guess, but try url;
http://localhost/zed/htdocs/rgfindingaids/series594.html
or
file://zed/htdocs/rgfindingaids/series594.html to bypass your web server
I am struggling with the section of the manual that deals with this as well.
http://us3.php.net/manual/en/ref.stream.php
hope this helps,
Warren Vail
> -----Original Message-----
> From: Mulley, Nikhil [mailto:mnikhil@corp.untd.com]
> Sent: Friday, October 08, 2004 6:58 AM
> To: Adam Williams; php-general@lists.php.net
> Subject: RE: [PHP] fopen and http://
>
>
> May be the path is not the correct ,just check with the Web
> Directory you configured to be and if its htdocs then I would say
> that its better to remove the htdocs from the path in fopen statement.
>
> -----Original Message-----
> From: Adam Williams [mailto:awilliam@mdah.state.ms.us]
> Sent: Friday, October 08, 2004 6:22 PM
> To: php-general@lists.php.net
> Subject: [PHP] fopen and http://
>
>
> Hi, I'm having a problem with fopen and http files. I keep getting the
> error:
>
> Warning: fopen(http://zed/htdocs/rgfindingaids/series594.html )
> [function.fopen]: failed to open stream: HTTP request failed!
> HTTP/1.1 404
> Not Found in /home/awilliam/public_html/rgfaidstest.php on line 15
> http://zed/htdocs/rgfindingaids/series594.html does not exist
>
> Warning: fopen(http://zed/htdocs/rgfindingaids/ser391.html )
> [function.fopen]: failed to open stream: HTTP request failed!
> HTTP/1.1 404
> Not Found in /home/awilliam/public_html/rgfaidstest.php on line 15
> http://zed/htdocs/rgfindingaids/ser391.html does not exist
>
> Warning: fopen(http://zed/htdocs/rgfindingaids/ser392.html )
> [function.fopen]: failed to open stream: HTTP request failed!
> HTTP/1.1 404
> Not Found in /home/awilliam/public_html/rgfaidstest.php on line 15
> http://zed/htdocs/rgfindingaids/ser392.html does not exist
>
>
>
> I have a text file /home/awilliam/public_html/rgfaids containing
> URLs such
> as:
>
> http://zed/htdocs/rgfindingaids/series594.html
> http://zed/htdocs/rgfindingaids/ser391.html
> http://zed/htdocs/rgfindingaids/ser392.html
>
> and I can bring up these URLs fine in a browser on the PC i'm running the
> script on.
>
> The following is my code:
>
> <?
>
> $filelist = fopen("/home/awilliam/public_html/rgfaids", "r");
>
> if (!$filelist)
> {
> echo "error opening rgfaids";
> exit;
> }
>
> while ( !feof($filelist))
> {
> $line = fgets($filelist, 99999);
>
> $filetotest = fopen("$line", "r");
>
> if (!$filetotest)
> {
> echo "$line does not exist<br>";
> }
> elseif ($filetotest)
> {
> echo "$line does exist";
> }
> }
>
> ?>
>
>
>
> But I don't understand why I am getting that error about failed to open
> strem: HTTP request failed, when I can bring up the links fine in a
> browser on the server running the php script. So can anyone help
> me out?
> Thanks
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
>
>