Re: [baltimorephp] Errors using imagecreate

From: Devon O.
Sent on: Monday, April 23, 2012 11:03 AM
Have you tried looking at the server response for the image? I bet
there's a PHP error or warning in there somewhere. I understand that
this is a test script, but you aren't checking for any errors. All of
the functions you call can return false on failure. Check return
values.

--dho

Op 23 april[masked]:52 heeft Joe Tseng <[address removed]> het
volgende geschreven:
> 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($myImag­e);
> ?>
>
> 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/ap­pl/pkgs/php/v5.3.9'
> '--with-apxs2=/expor­t/appl/pkgs/httpd/la­test/bin/apxs'
> '--with-mysql=/expor­t/appl/pkgs/mysql/la­test'
> '--with-mysqli=/expo­rt/appl/pkgs/mysql/l­atest/bin/mysql_conf­ig'
> '--with-gd=/export/a­ppl/pkgs/libgd/lates­t' '--with-pear'
> '--with-png-dir=/exp­ort/appl/pkgs/libpng­/latest'
> '--with-jpeg-dir=/ex­port/appl/pkgs/jpeg/­latest'
> '--with-curl=/export­/appl/pkgs/curl/late­st'
> '--with-freetype-dir­=/export/appl/pkgs/f­reetype/latest'
> '--with-mhash=/expor­t/appl/pkgs/mhash/la­test'
> '--with-mcrypt=/expo­rt/appl/pkgs/libmcry­pt/latest' '--enable-pcntl'
> '--enable-soap' '--enable-mbstring'
> '--with-zlib-dir=/ex­port/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]

Our Sponsors

Sign up

Meetup members, Log in

By clicking "Sign up" or "Sign up using Facebook", you confirm that you accept our Terms of Service & Privacy Policy