Nivalis Posted December 28, 2008 Share Posted December 28, 2008 I'm somewhat perplexed, i've two generic-ish scripts that are on my local server and my web server, they work perfectly fine on my web server but my local server only the first script actually works. The local server is running Windows 2003 Enterprise, with Apache 2.2.11 running, along side PHP 5.2.8, both freshly installed, with the GD extension installed on PHP via it's installer menus, i've gone in there and checked the php_gd2.dll line manually and it's fine, i've made sure temp directories are writable and that the mime types are all set up, the first script works, and tests such as gd_info come back positive, First script is as follows : <?php header("Content-type: image/png"); $string = $_GET['text']; $im = imagecreatefrompng("button1.png"); $orange = imagecolorallocate($im, 220, 210, 60); $px = (imagesx($im) - 7.5 * strlen($string)) / 2; imagestring($im, 3, $px, 9, $string, $orange); imagepng($im); imagedestroy($im); ?> This works fine on both the web server and local server. However this second script : <?php header ("Content-type: image/png"); $src = array ('base.jpg', $_GET['x'], $_GET['y']); $imgBuf = array (); foreach ($src as $link) { switch(substr ($link,strrpos ($link,".")+1)) { case 'png': $iTmp = imagecreatefrompng($link); break; case 'gif': $iTmp = imagecreatefromgif($link); break; case 'jpeg': case 'jpg': $iTmp = imagecreatefromjpeg($link); break; } array_push ($imgBuf,$iTmp); } $iOut = imagecreatetruecolor ("200","200") ; foreach ($imgBuf as $image) { imagecopy($iOut,$image,0,0,0,0,imagesx($image),imagesy($image)); } imagepng($iOut); ?> Only works on my web server, not my local server, even though the files are the same and (to my knowledge), the functionality of the gd versions is too. Is there anything i could be overlooking here? Thanks in advance. Quote Link to comment https://forums.phpfreaks.com/topic/138611-gd-problem-with-php-528-on-apache-2211/ Share on other sites More sharing options...
PFMaBiSmAd Posted December 28, 2008 Share Posted December 28, 2008 It would be real nice it you told us what it was doing, rather than just that it does not work. What do you see in front of you? Edit: my edit to match information you changed in the post. You need to post your actual code in your file. Your first posted code, before you edited the post, contained a short open tag <? that if actually present would explain why the code is not working. Quote Link to comment https://forums.phpfreaks.com/topic/138611-gd-problem-with-php-528-on-apache-2211/#findComment-724750 Share on other sites More sharing options...
Nivalis Posted December 28, 2008 Author Share Posted December 28, 2008 It would be real nice it you told us what it was doing, rather than just that it does not work. What do you see in front of you? Edit: my edit to match information you changed in the post. Displaying a blank page when loading, also about the <?php instead of <? was just a cut+paste error when making the post, rectified it a moment ago. i *THINK* i've figured it out, which made the few minutes writing this post up kind of worthless now, the secondary scsi drive is failing integrity checks, and the second drive is where i have my temp folders setup, as well as where php is installed, going to reinstall php to another drive and see if it solves the problem Quote Link to comment https://forums.phpfreaks.com/topic/138611-gd-problem-with-php-528-on-apache-2211/#findComment-724752 Share on other sites More sharing options...
Nivalis Posted December 28, 2008 Author Share Posted December 28, 2008 Ah all sorted, while the php install was still good, the web server files (while good in part), were corrupting, so when i moved the files via ftp from my laptop to the local server, even though they were showing up they were 0 bytes, ack!, feel rather stupid now. Thanks anyway for the help, off to find a new drive now :-\ Quote Link to comment https://forums.phpfreaks.com/topic/138611-gd-problem-with-php-528-on-apache-2211/#findComment-724754 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.