php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #37717 gzopen fails with http, bad request
Submitted: 2006-06-06 19:46 UTC Modified: 2006-10-26 01:00 UTC
Votes:4
Avg. Score:4.5 ± 0.9
Reproduced:4 of 4 (100.0%)
Same Version:3 (75.0%)
Same OS:3 (75.0%)
From: chrissavery at gmail dot com Assigned:
Status: No Feedback Package: Zlib related
PHP Version: 5.1.4 OS: WinXP
Private report: No CVE-ID: None
Have you experienced this issue?
Rate the importance of this bug to you:

 [2006-06-06 19:46 UTC] chrissavery at gmail dot com
Description:
------------
using gzopen to open remote files. has worked fine in php 4.3.11
after upgrade to 5.1.4 I get failure with REQUEST METHOD not handled. I can see that it is because the reuest method is stated as ET and not GET as it should be. so seems like some kind of buffer overrun perhaps.
fopen works fine. but fopen('compress.zlib://.. also fails the same way.
reverted back to 4.3.11 and tested again and it works fine there.
currently this will prevent me from migrating to php 5

Reproduce code:
---------------
gzopen("http://my.example.com/mods/$f-$site.gz", 'rb')

where in my exact case the $f is 'features' and $site is '0'


Expected result:
----------------
open the file ready to read contents.

Actual result:
--------------
error indicating HTTP request is bad.

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2006-06-06 19:57 UTC] tony2001@php.net
Please try using this CVS snapshot:

  http://snaps.php.net/php5.2-latest.tar.gz
 
For Windows:
 
  http://snaps.php.net/win32/php5.2-win32-latest.zip

Can't reproduce:
# php -r 'var_dump(gzopen("http://tony2001.phpclub.net/3.php.gz", "r"));'
resource(6) of type (stream)

 [2006-06-06 21:20 UTC] chrissavery at gmail dot com
Have just tried php5.2-win32 as requested. get same results.
error msg and log server entry shown below. server is Apache 2.0.52. 

Warning: gzopen(http://www.localseller.com/mods/features-0.gz) [function.gzopen]: failed to open stream: HTTP request failed! HTTP/1.1 501 Method Not Implemented in C:\Documents and Settings\Chris\My Documents\WebSites\Optimal\am\mod.php on line 16

[Wed Jun 07 04:12:55 2006] [error] [client 127.0.0.1] Invalid method in request ET /mods/features-0.gz HTTP/1.0

Simply changing function call from gzopen to fopen succeeds. I reinstalled apache as well because I thought maybe something had corrupted it.
 [2006-06-06 21:30 UTC] chrissavery at gmail dot com
have just tried same php cmd line call to your server. result was same:

C:\Documents and Settings\Chris>php -r "var_dump(gzopen('http://tony2001.phpclub
.net/3.php.gz','r'));"

Warning: gzopen(http://tony2001.phpclub.net/3.php.gz): failed to open stream: HT
TP request failed! HTTP/1.0 501 Method Not Implemented
 in Command line code on line 1
bool(false)
 [2006-06-06 21:37 UTC] tony2001@php.net
Please make sure you've updated ALL the .dlls and turned off all firewalls etc, which might affect it.
 [2006-06-08 08:50 UTC] chrissavery at gmail dot com
Have tested with php4 directory renamed to prevent mistaken use of some resource. Also re-extracted all files from root of Win325.2 archive, and some needed ext dlls as well. All should be correct versions. Problem still persists on various tested urls. Please check your server logs as when I tried that one it would have left an ET request when it should have been GET.
This is on my test Win32  server but my real server runs on Linux. I'm hoping that when I do upgrade tests on that it's working ok on Linux. 
Chris :)
 [2006-10-18 21:31 UTC] tony2001@php.net
Please try using this CVS snapshot:

  http://snaps.php.net/php5.2-latest.tar.gz
 
For Windows:
 
  http://snaps.php.net/win32/php5.2-win32-latest.zip

Works just fine here:

C:\php -r "var_dump(gzopen('http://tony2001.phpclub.net/3.php.gz','r'));"
resource(6) of type (stream)

 [2006-10-26 01:00 UTC] php-bugs at lists dot php dot net
No feedback was provided for this bug for over a week, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".
 
PHP Copyright © 2001-2019 The PHP Group
All rights reserved.
Last updated: Thu Aug 22 07:01:26 2019 UTC