|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2003-01-06 20:17 UTC] info at ofek dot com
function ImgExists($f) {
$r=@getimagesize("http://localhost/$f");
return $r[2]!=0;
}
if(ImgExists('icon.jpg')) echo('exists!');
when calling this function, php.exe (4.3.0 as CGI in IIS4) is crashing. remark out the 'getimagesize' line, and it won't crash.
i can email my php.ini on request.
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Fri Oct 24 03:00:02 2025 UTC |
HOLD IT - I just found out exactly how to reproduce it. please read carefully. the code is: <?php function ImageExists($url) { $r=@getimagesize($url); return $r[2]!=0; } echo ImageExists('http://domain/dir1/dir2/dir3/image.gif'); ?> make sure the path: http://domain/dir1/dir2/dir3/ containts THREE directories after the domain (i.e. 6 forward-slashes total), and that the PATH physically EXISTS. AND make sure that the file (in code 'image.gif') DOES NOT exist. You can test against: http://economads.com/libaware/_font/title/image.gif This crashes on my server - running PHP 4.3.0 as CGI with IIS Win2000. Hope this helps.I doesn't crash for me anymore using this script: <?php var_dump(getimagesize('http://economads.com/libaware/_font/title/image.gif')); ?> Can you verify that this exact script causes the crash? And if so, could you also test this on some other machine too?that script you posted doesn't crash on my system either - but this one does: function ImageExists($url) { $r=@getimagesize($url); return $r[2]!=0; } echo ImageExists('http://economads.com/libaware/_font/title/123456.gif'); it's funny, if the file name is 12345.gif it doesn't crash, but if it's 123456.gif than it does!