Adamn Posted May 11, 2007 Share Posted May 11, 2007 I just upgraded to windows XP from Vista (fresh reformat) and I'm having a very strange problem with getting the gd2 library to work. http://localhost/phpinfo.php yields PHP Version 4.3.10 .. .. gd GD Support enabled GD Version bundled (2.0.28 compatible) FreeType Support enabled FreeType Linkage with freetype GIF Read Support enabled GIF Create Support enabled JPG Support enabled PNG Support enabled WBMP Support enabled XBM Support enabled .. This would be all well and good, except a very simple test script will produce an error: The image “http://localhost/square.png” cannot be displayed, because it contains errors. square.png: <?php $im = imagecreatetruecolor(100, 100); // sets background to red $red = imagecolorallocate($im, 255, 0, 0); imagefill($im, 0, 0, $red); header('Content-type: image/png'); imagepng($im); imagedestroy($im); ?> For the life of me, this is the simplest thing I could do with the gd library, and it won't work. I'm stumped. Quote Link to comment https://forums.phpfreaks.com/topic/50978-very-odd-gd2-problem/ Share on other sites More sharing options...
Barand Posted May 11, 2007 Share Posted May 11, 2007 Try renaming the file "square.php" Quote Link to comment https://forums.phpfreaks.com/topic/50978-very-odd-gd2-problem/#findComment-250799 Share on other sites More sharing options...
chigley Posted May 11, 2007 Share Posted May 11, 2007 Comment out the header line and run the file. Look for errors before the image code/hash is outputted. Let me know what the error is Quote Link to comment https://forums.phpfreaks.com/topic/50978-very-odd-gd2-problem/#findComment-250800 Share on other sites More sharing options...
Adamn Posted May 12, 2007 Author Share Posted May 12, 2007 Try renaming the file "square.php" Senile Super Moderator Genius (it worked. Thank you!) Quote Link to comment https://forums.phpfreaks.com/topic/50978-very-odd-gd2-problem/#findComment-251082 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.