ID: 49611 Updated by: ras...@php.net Reported By: d dot reade at readesresidential dot com Status: Open Bug Type: Filesystem function related Operating System: CentOS 5.3 x86 PHP Version: 5.2.11 New Comment:
It would be really helpful if you could create an actual script that reproduces this. It isn't until the 8th comment on this bug that we learn that it only happens if you are doing a whole bunch of them together. Your original reproducing script not only didn't have any network component, but it also didn't have anything about multiple connections. How are you doing these multiple connections? Just a big loop around file_get_contents? The best way to report a bug is to simplify your problem down into a script that we can run ourselves and see the problem. If we can see it, we can fix it. Otherwise we are guessing as to what might be happening on your end. Previous Comments: ------------------------------------------------------------------------ [2009-09-20 22:44:06] paj...@php.net I was thinking about a bug the curl stream wrapper, but no. I can't reproduce this problem either, no matter the web server/OS/platform. ------------------------------------------------------------------------ [2009-09-20 22:21:10] d dot reade at readesresidential dot com Sure, here it is: './configure' '--disable-pdo' '--enable-bcmath' '--enable-calendar' '--enable-ftp' '--enable-gd-native-ttf' '--enable-libxml' '--enable-magic-quotes' '--enable-sockets' '--enable-zip' '--prefix=/usr/local' '--with-apxs2=/usr/local/apache/bin/apxs' '--with-freetype-dir=/usr' '--with-gd' '--with-imap=/opt/php_with_imap_client/' '--with-imap-ssl=/usr' '--with-jpeg-dir=/usr' '--with-kerberos' '--with-libxml-dir=/opt/xml2/' '--with-mcrypt=/opt/libmcrypt/' '--with-mysql=/usr' '--with-mysql-sock=/var/lib/mysql/mysql.sock' '--with-png-dir=/usr' '--with-t1lib=/usr' '--with-ttf' '--with-xpm-dir=/usr' '--with-zlib' '--with-zlib-dir=/usr' ------------------------------------------------------------------------ [2009-09-20 22:19:25] paj...@php.net Can you show us your configure line too please? ------------------------------------------------------------------------ [2009-09-20 22:08:14] d dot reade at readesresidential dot com That works fine, but it's a single file. The script I'm running is fetching up to 80 images from a remote source (based on the same network) and compiling into a PDF. I rebooted the server a few minutes ago and tried again... The script completed no problem, fetched all images and compiled into a PDF. So I tried again, but it failed half way through. The reason it gave was imagecreatefrompng complaining one of the PNG files was corrupt. I checked the PNG file and it contained the header information: HTTP/1.1 200 OK Date: Sun, 20 Sep 2009 22:03:29 GMT Server: Apache Last-Modified: Tue, 15 Sep 2009 14:04:55 GMT Accept-Ranges: bytes Content-Length: 883 Cache-Control: max-age=2592000 Expires: Tue, 20 Oct 2009 22:03:29 GMT Connection: close Content-Type: image/png �PNG There were other files in the same folder (the /tmp folder) that were created as part of the same job, which compiled into temporary PNGs and JPEGs no problem, with no header information. This has only started happening since PHP 5.2.11. I thought this was a bug since if I recompile Apache with PHP 5.2.10 instead leaving the configuration in tact, and try again, the script completes, again and again no problem. It never fails. Is there any reason why PHP is adding header info to files instead of just the file contents? ------------------------------------------------------------------------ [2009-09-20 21:04:58] ras...@php.net And you can reproduce it with a 2-liner like that? I can't on my Linux box. Try this on your system: $img = file_get_contents('http://slowgeek.com/flat.png'); file_put_contents('flat.png',$img); run it a couple of times from the command line. Is your flat.png ever corrupted? ------------------------------------------------------------------------ The remainder of the comments for this report are too long. To view the rest of the comments, please view the bug report online at http://bugs.php.net/49611 -- Edit this bug report at http://bugs.php.net/?id=49611&edit=1