Re: PHP 4.0 Bug #7918: fopen fails to open file of form http://....
| From: | Stig Venaas | Date: | Sun, 26 Nov 2000 19:43:21 +0000 |
| Subject: | Re: PHP 4.0 Bug #7918: fopen fails to open file of form http://.... | ||
| References: | 1 | Groups: | php.dev |
| Request: | Send a blank email to php-dev+get-39156@lists.php.net to get a copy of this message | ||
On Wed, Nov 22, 2000 at 04:38:12AM -0000, david@buchan.org wrote:
> From: david@buchan.org
> Operating system: Linux Redhat 7.0
> PHP version: 4.0.3pl1
> PHP Bug Type: Filesystem function related
> Bug description: fopen fails to open file of form http://....
>
> [This is related to bug 7894 which was closed without statement of resolution. It looks to be
> the same error].
>
> In performing a local installation of Sourceforge 2.0 on Linux Redhat 7.0, the following error
> occurs with the fopen statement of the form:
>
>
> fopen("http://sourceforge/write_cache.php?sys_themeid=1&function=0","r";)
>
>
> The file is not opened and subsequent use of the file handles confirm that.
>
> If the url is typed directly into Netscape's Address box it works fine and the expected
> results are returned.
>
> Users on the Sourceforge offsite discussion group report everthing was fine until 4.03x was
> installed.
From 4.0.3 on, fopen will use getaddrinfo for host name lookups (if
available), so that could possibly be the cause, but this is working
just fine for me on RedHat7. Are you sure that the name resolves? I
see you just wrote sourceforge there.
It would be great if you could assist in some debugging. If you know
how to use gdb you could hopefully see what happens. If not, could
you compile PHP standalone with no extras (just do ./configure), and
create a script test.php
<?php
echo fopen("http://sourceforge/write_cache.php?sys_themeid=1&function=0","r");
?>
then do
./php test.php. If it doesn't output Resource id.... please mail me the
output of
strace ./php test.php
If it fails, could you check that it works with a version prior to 4.0.3?
Stig