addressalign-toparrow-leftarrow-leftarrow-right-10x10arrow-rightbackbellblockcalendarcameraccwcheckchevron-downchevron-leftchevron-rightchevron-small-downchevron-small-leftchevron-small-rightchevron-small-upchevron-upcircle-with-checkcircle-with-crosscircle-with-pluscontroller-playcredit-cardcrossdots-three-verticaleditemptyheartexporteye-with-lineeyefacebookfolderfullheartglobe--smallglobegmailgooglegroupshelp-with-circleimageimagesinstagramFill 1languagelaunch-new-window--smalllight-bulblightning-boltlinklocation-pinlockm-swarmSearchmailmediummessagesminusmobilemoremuplabelShape 3 + Rectangle 1ShapeoutlookpersonJoin Group on CardStartprice-ribbonprintShapeShapeShapeShapeImported LayersImported LayersImported Layersshieldstar-shapestartickettrashtriangle-downtriangle-uptwitteruserwarningyahooyoutube

RE: [baltimorephp] Errors using imagecreate

From: Joe T.
Sent on: Monday, April 23, 2012, 4:53 PM
Just to cut down on the clutter, I removed everything from my PHP file and had just the header file:

header("Content-type: image/png");

That was enough to generate that error.



Date: Mon, 23 Apr[masked]:07:58 -0700
From: [address removed]
Subject: Re: [baltimorephp] Errors using imagecreate
To: [address removed]


Comment out the header line and see what is being output.  It should be a bunch of line noise, but that way you can see if any text is being inadvertently being displayed.  A php error/warning/notice is the usual cause of this result.  Knowing the errors will help you troubleshoot.  Also make sure there isn't any whitespace after the ?> tag (or just omit it from the file entirely).
Kevin


From: Joe Tseng <[address removed]>
To: [address removed]
Sent: Monday, April 23,[masked]:52 AM
Subject: [baltimorephp] Errors using imagecreate

I recently migrated some apps to a new Solaris server and I'm getting some errors back with some graphics-related calls.  Just as a test I inserted a small test script:

<?php
    header('Content-type: image/png');
    $myImage = imagecreate(200, 100);
    $myGray = imagecolorallocate($myImage, 204, 204, 204);
    $myBlack = imagecolorallocate($myImage, 0, 0, 0);
    imageline($myImage, 15, 35, 120, 60, $myBlack);

    imagepng($myImage);
    imagedestroy($myImage);
?>

And I got the following message:

The image "..." cannot be displayed because it contains errors.

My PHP instance was compiled from source per a request from our server group.  My makefile was created using the following flags:

'./configure' '--prefix=/export/appl/pkgs/php/v5.3.9' '--with-apxs2=/export/appl/pkgs/httpd/latest/bin/apxs' '--with-mysql=/export/appl/pkgs/mysql/latest' '--with-mysqli=/export/appl/pkgs/mysql/latest/bin/mysql_config' '--with-gd=/export/appl/pkgs/libgd/latest' '--with-pear' '--with-png-dir=/export/appl/pkgs/libpng/latest' '--with-jpeg-dir=/export/appl/pkgs/jpeg/latest' '--with-curl=/export/appl/pkgs/curl/latest' '--with-freetype-dir=/export/appl/pkgs/freetype/latest' '--with-mhash=/export/appl/pkgs/mhash/latest' '--with-mcrypt=/export/appl/pkgs/libmcrypt/latest' '--enable-pcntl' '--enable-soap' '--enable-mbstring' '--with-zlib-dir=/export/appl/zlib/v1.2.5' '--with-ldap'

I don't think any sort of error msg would be visible in the Apache error or access log.  Am I missing anything in my script or my compile command?

thx,

 - Joe


If you type "Google" into Google, you can break the Internet.  -- Jen Barber




--
Please Note: If you hit "REPLY", your message will be sent to everyone on this mailing list ([address removed])
This message was sent by Joe Tseng ([address removed]) from Baltimore PHP.
To learn more about Joe Tseng, visit his/her member profile
Set my mailing list to email me As they are sent | In one daily email | Don't send me mailing list messages

Meetup, PO Box 4668 #37895 New York, New York[masked] | [address removed]


People in this
group are also in: