|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #36473 Foreign Images w/getimagesize() crash Apache2
Submitted: 2006-02-21 10:50 UTC Modified: 2010-07-07 10:37 UTC
Avg. Score:4.5 ± 0.8
Reproduced:4 of 4 (100.0%)
Same Version:3 (75.0%)
Same OS:2 (50.0%)
From: punkpuke at terraimpetus dot com Assigned: pajoye (profile)
Status: Closed Package: Apache2 related
PHP Version: 4.4.2 OS: Windows XP Pro
Private report: No CVE-ID: None
View Add Comment Developer Edit
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
Solve the problem:
42 - 10 = ?
Subscribe to this entry?

 [2006-02-21 10:50 UTC] punkpuke at terraimpetus dot com
When accessing foreign URLs with getimagesize(), apache server crashes with:

szAppName : Apache.exe     szAppVer :     szModName : php4ts.dll     
szModVer :     offset : 000c5fca

The only changes made to the PHP.ini file were the enabling/removing the comment in front of the GD2 and the ZIP, DLL extensions.

Server is running as a test environment on localhost.

Reproduce code:
getimagesize('images/example.gif');  //Works Fine (Local)
getimagesize('example.jpg'); //Works Fine
//The following crash the Entire Apache server, no matter where they're used
getimagesize(''); //Crashes 
getimagesize(''); //Crashes
@getimagesize(''); //Crashes

Expected result:
Apache 2 Servers lags for a slight moment, then crashes 100% of the time that a page using a foreign URL call to getimagesize() is run.


image (last revision 2011-01-31 08:11 UTC by ishanka_layanthi at yahoo dot com)

Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2006-02-21 13:52 UTC]
Thank you for this bug report. To properly diagnose the problem, we
need a backtrace to see what is happening behind the scenes. To
find out how to generate a backtrace, please read for *NIX and for Win32

Once you have generated a backtrace, please submit it to this bug
report and change the status back to "Open". Thank you for helping
us make PHP better.

Works fine here.
 [2006-02-21 20:04 UTC] punkpuke at terraimpetus dot com
I would love to help, however those instructions aren't detailed enough for me to do anything.  I need to know the exact files I need and where to put them.  I'm sorry, I'm not that smart. :(
 [2006-02-21 23:10 UTC]
Please try using this CVS snapshot:
For Windows:

 [2006-02-24 13:59 UTC] Peter at ibforen dot de
I have had a similar problem with IIS and php.exe:

With external urls getimagesize causes an indefinite loop in that function.

Using the isapi module php4isapi.dll solves the problem.
 [2006-02-27 17:16 UTC] stitched at mindspring dot com
This also happens with Apache 1.3.33 and 2.0.54 consistently with 4.4.2 on Windows 2000.  Will try to get a backtrack but given where and when it's crashing it may not work.

 [2006-02-27 21:33 UTC] stitched at mindspring dot com
I can confirm that this problem is fixed with 5.1.2.  I didn't see a backtrace version for 4.4.2 so was unable to get one.  But something is certainly broken in 4.4.2.

 [2006-03-01 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".
 [2006-03-16 15:03 UTC] jaroslav dot povolny at gmail dot com
I am getting the same error without Apache environment when using function file_get_contents() and file() with http protocol... I think it is connected
 [2006-03-16 15:07 UTC] jaroslav dot povolny at gmail dot com
I have just installed back 4.4.1 version and the bug disappeared. It is definetelly 4.4.2 bug, it is somewhere in file() or file_get_contents(). Platform: Windows XP
 [2006-04-05 02:57 UTC] nospam at fidk dot com
Get the same problem (PHP crashes) with fopen as well as file and file_get_contents.  Under 4.2.2.  Try this code:

    $host = '';
    $location =   "/dataserver0_9/httpparam?dataSource=airsigmets&requestType=retrieve&format=xml&minLat=25&minLon=-130&maxLat=65&maxLon=-40&hoursBeforeNow=3";

   $pirepUrl = "http://".$host.$location;
   $fd = fopen($pirepUrl, "rb");


 [2006-04-05 06:37 UTC]
This bug has been fixed in CVS 3 months ago.
 [2010-07-07 08:01 UTC] nooshin dot ha at gmail dot com
I have the same problem! even though there is sentence at the bottom of this page which claims the problem has been solved! I PHP 5.2.8 and Apache 2! as soon as I deactivate the part of code which uses the get_image_size function everything's ok! but if I let it run, Apaches crash and MySQL returns hundreds of Null Sleep State queries because it can not connect to Apache!
I wanna know what PHP & Apache version support the function with out problem?

P.S: unfortunately due to Apache crash, the log file doesn't return any error..
 [2010-07-07 08:18 UTC] nooshin dot ha at gmail dot com
well, I think I solved the problem by myself! we defined a sub domain for our images (e.g and we address the images to the function with this url-base method! I changed it to directory-base like this "/images/"and it works fine!!! however I used linux server ...
 [2010-07-07 10:37 UTC]
-Assigned To: +Assigned To: pajoye
 [2010-07-07 10:37 UTC]
Open a new bug using the image crashing imagegetsize (provide a link to it). Also please try using the latest PHP or RC before.
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sat May 18 20:01:34 2024 UTC