MrCreeky Posted November 6, 2009 Share Posted November 6, 2009 I have just discovered after hrs of trying to fix a problem where it's coming from. It's to do with the php function getimagesize() and path names. When using these two different sets of code: <?php list($width, $height, $type, $attr) = getimagesize("store_closed.gif"); echo "<img src=\"store_closed.gif\" $attr alt=\"getimagesize() example\" />"; ?> <?php list($width,$height,$type,$attr)=getimagesize("C:\inetpub\wwwroot\hifisquad.com\store_closed.gif"); echo $width; echo $height; echo $type; echo $attr; ?> However when I try and use this function with a path like this: http://www.myname.com/store_closed.gif the page errors. I'm running this system on a Win2008 IIS7 server, is there a setting to enable the above style of path or am I missing something else? Quote Link to comment https://forums.phpfreaks.com/topic/180554-iis7-and-getimagesize-problem/ Share on other sites More sharing options...
rajivgonsalves Posted November 6, 2009 Share Posted November 6, 2009 the function can only get the image file size of local file you will have to fetch the file off the web write it to a local file and then run the function Quote Link to comment https://forums.phpfreaks.com/topic/180554-iis7-and-getimagesize-problem/#findComment-952556 Share on other sites More sharing options...
MrCreeky Posted November 6, 2009 Author Share Posted November 6, 2009 Hi, The problem with that is this code is part of a pre-built shopping cart system and it's error-ing when it's generating the customer email and the admin email. All the files that are being called are located on the sever so I don't know what to do. Quote Link to comment https://forums.phpfreaks.com/topic/180554-iis7-and-getimagesize-problem/#findComment-952568 Share on other sites More sharing options...
Daniel0 Posted November 6, 2009 Share Posted November 6, 2009 the function can only get the image file size of local file you will have to fetch the file off the web write it to a local file and then run the function Sure about that? daniel@daniel-laptop:~$ php -r "var_dump(getimagesize('http://www.phpfreaks.com/media/images/forums/bg_header.png'));" array(6) { [0]=> int(950) [1]=> int(133) [2]=> int(3) [3]=> string(24) "width="950" height="133"" ["bits"]=> int( ["mime"]=> string(9) "image/png" } daniel@daniel-laptop:~$ However when I try and use this function with a path like this: http://www.myname.com/store_closed.gif the page errors. Do you want us to guess the errors, or are you going to tell us? Quote Link to comment https://forums.phpfreaks.com/topic/180554-iis7-and-getimagesize-problem/#findComment-952576 Share on other sites More sharing options...
MrCreeky Posted November 6, 2009 Author Share Posted November 6, 2009 Sorry I forgot that not everyone psychic ability is as good as mine This was the error from the second code I printed: PHP Warning: getimagesize(http://www.hifisquad.com/store_closed.gif) [function.getimagesize]: failed to open stream: A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond. in C:\inetpub\wwwroot\hifisquad.com\getim.php on line 2 I think I may have found the fault, but will let you know.... Quote Link to comment https://forums.phpfreaks.com/topic/180554-iis7-and-getimagesize-problem/#findComment-952596 Share on other sites More sharing options...
rajivgonsalves Posted November 6, 2009 Share Posted November 6, 2009 sorry about I guess I was wrong don't know from where I got that in my head Quote Link to comment https://forums.phpfreaks.com/topic/180554-iis7-and-getimagesize-problem/#findComment-952651 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.