php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #21267 fopen() fails on some URLs
Submitted: 2002-12-29 09:44 UTC Modified: 2003-01-03 11:07 UTC
From: patric at liefdeis dot com Assigned:
Status: Closed Package: *URL Functions
PHP Version: 4.4.0-dev OS: FreeBSD
Private report: No CVE-ID:
 [2002-12-29 09:44 UTC] patric at liefdeis dot com
When trying fopen() on http://, it fails on some urls.

Example:

fopen("http://www.smswhiz.com/","r");

Gives stream error. The site IS touched, but you do not receive any data back from the site.

While for example:

fopen("http://www.tweakers.net/","r");

Does work without any problem!

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2002-12-29 10:05 UTC] rasmus@php.net
That's because of the silly 302 temporary redirect to a relative URL with GET-method args that is done on that site.  Open the right location and it should work fine.  We probably should support this at some point though.
 [2002-12-29 12:06 UTC] patric at liefdeis dot com
But can you tell me why in version 4.2.3 this works perfect?
 [2002-12-29 14:03 UTC] iliaa@php.net
This bug has been fixed in CVS.

In case this was a PHP problem, snapshots of the sources are packaged
every three hours; this change will be in the next snapshot. You can
grab the snapshot at http://snaps.php.net/.
 
In case this was a documentation problem, the fix will show up soon at
http://www.php.net/manual/.

In case this was a PHP.net website problem, the change will show
up on the PHP.net site and on the mirror sites in short time.
 
Thank you for the report, and for helping us make PHP better.


 [2003-01-03 05:12 UTC] patric at liefdeis dot com
Tnx for the fast change, and it is almost working. But one thing still doesn't:

When you open:

http://www.smswhiz.com/http2sms/sendsms.asp

You get a redirect to sendfailed.htm. The new URL to open should be:

http://www.smswhiz.com/http2sms/sendfailed.htm

and this site exists. But when I try it with PHP (with the latest snapshot ofcourse), I get a 404, so I think it opens:

http://www.smswhiz.com/sendfailed.htm

I know, IIS 5.0 really sucks in those redirects, but can you maybe fix this problem too? Tnx!
 [2003-01-03 10:25 UTC] iliaa@php.net
This bug has been fixed in CVS.

In case this was a PHP problem, snapshots of the sources are packaged
every three hours; this change will be in the next snapshot. You can
grab the snapshot at http://snaps.php.net/.
 
In case this was a documentation problem, the fix will show up soon at
http://www.php.net/manual/.

In case this was a PHP.net website problem, the change will show
up on the PHP.net site and on the mirror sites in short time.
 
Thank you for the report, and for helping us make PHP better.

404 means the page cannot be found, openning 404 error handler URL is counter intuitive since it implies that the fopen() succeeded opening the request page, even though the requested page does not exist.
This will not be fixed.
 [2003-01-03 10:40 UTC] patric at liefdeis dot com
No, you didn't understand the problem. In reality it doesn't return a 404 error, but because a 302 is given back in the form:

newpage.htm

but is handled as /newpage.htm, it opens the wrong redirect and that returns a 404. In PHP 4.2.x this works fine.
The URL:

http://www.smswhiz.com/http2sms/sendsms.asp

Does not return a 404-error when you follow it manually!
 [2003-01-03 11:07 UTC] iliaa@php.net
This bug has been fixed in CVS.

In case this was a PHP problem, snapshots of the sources are packaged
every three hours; this change will be in the next snapshot. You can
grab the snapshot at http://snaps.php.net/.
 
In case this was a documentation problem, the fix will show up soon at
http://www.php.net/manual/.

In case this was a PHP.net website problem, the change will show
up on the PHP.net site and on the mirror sites in short time.
 
Thank you for the report, and for helping us make PHP better.


 
PHP Copyright © 2001-2014 The PHP Group
All rights reserved.
Last updated: Thu Apr 24 02:02:10 2014 UTC