From:             [EMAIL PROTECTED]
Operating system: WinXP
PHP version:      5.1.6
PHP Bug Type:     Streams related
Bug description:  file_get_contents for a URL returns nothing when file > 255 
bytes

Description:
------------
I am using file_get_contents with a URL. If the file I want to get is 255
bytes I get it fine. If it is 256 bytes or more, up to some upper limit
which is somewhere around 3.5K, I get an empty string. 

Although I have only illustrated it with file_get_contents(), from the
circumstances in which I first noticed odd behaviour I think it also
applies generally to files opened with fopen(). 

Incidentally, the right number of bytes are coming from the web server, as
the apache access log shows it is delivering 256 bytes:

127.0.0.1 - - [14/Sep/2006:12:34:37 +0100] "GET
/MyService/AddressBook/info.xsd HTTP/1.0" 200 256

Reproduce code:
---------------
echo
file_get_contents('http://localhost/MyService/AddressBook/info.xsd');

where the target file info.xsd is 256 bytes long




Expected result:
----------------
the contents of the file

Actual result:
--------------
nothing - empty string

-- 
Edit bug report at http://bugs.php.net/?id=38826&edit=1
-- 
Try a CVS snapshot (PHP 4.4): 
http://bugs.php.net/fix.php?id=38826&r=trysnapshot44
Try a CVS snapshot (PHP 5.2): 
http://bugs.php.net/fix.php?id=38826&r=trysnapshot52
Try a CVS snapshot (PHP 6.0): 
http://bugs.php.net/fix.php?id=38826&r=trysnapshot60
Fixed in CVS:                 http://bugs.php.net/fix.php?id=38826&r=fixedcvs
Fixed in release:             
http://bugs.php.net/fix.php?id=38826&r=alreadyfixed
Need backtrace:               http://bugs.php.net/fix.php?id=38826&r=needtrace
Need Reproduce Script:        http://bugs.php.net/fix.php?id=38826&r=needscript
Try newer version:            http://bugs.php.net/fix.php?id=38826&r=oldversion
Not developer issue:          http://bugs.php.net/fix.php?id=38826&r=support
Expected behavior:            http://bugs.php.net/fix.php?id=38826&r=notwrong
Not enough info:              
http://bugs.php.net/fix.php?id=38826&r=notenoughinfo
Submitted twice:              
http://bugs.php.net/fix.php?id=38826&r=submittedtwice
register_globals:             http://bugs.php.net/fix.php?id=38826&r=globals
PHP 3 support discontinued:   http://bugs.php.net/fix.php?id=38826&r=php3
Daylight Savings:             http://bugs.php.net/fix.php?id=38826&r=dst
IIS Stability:                http://bugs.php.net/fix.php?id=38826&r=isapi
Install GNU Sed:              http://bugs.php.net/fix.php?id=38826&r=gnused
Floating point limitations:   http://bugs.php.net/fix.php?id=38826&r=float
No Zend Extensions:           http://bugs.php.net/fix.php?id=38826&r=nozend
MySQL Configuration Error:    http://bugs.php.net/fix.php?id=38826&r=mysqlcfg

Reply via email to