dogshasha Posted February 3, 2009 Share Posted February 3, 2009 Greetings to all, I have a problem displaying an image on the Web. My environment is PHP 5.2.8, 64-bit Operating System. Windows Server Standard SP1 and is using php5isapi.dll: ISAPI v4.0. <?php //require 'config.php'; $image = imagecreate(200, 110); $bg = imagecolorallocate($image, 225, 0, 0); $color = imagecolorallocate($image, 255, 255, 255); imageline($image,10, 10, 60, 60, $color); header("Content-type: image/png"); imagepng($image); ?> config.php is a standard php file in the same directory. <?php $myvar1='some value'; ?> The problem is if I require(require_once, include) config.php at the beginning of the script(see the red colored line above), the browser gives me the error "The image “http://www.myserver.com/DrawALine.php” cannot be displayed, because it contains errors.". If I comment this line out or move it to the end of the script, the image shows up. I understand that header must be sent to browser before anything else, even a space character. I double checked to make sure there is no spaces in the script before header("Content-type: image/png"); When I copied the same code to a 32-bit windows machine. It worked. As far as I can tell, the only difference between my 2 test machines is one is 32-bit and the other is 64-bit. Can somebody here shed some light on it? Any suggestions will be greatly appreciated, Link to comment https://forums.phpfreaks.com/topic/143635-php-compatibility-issue-with-64-bit-windows-machine-on-php-gd-library/ Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.