Self-compiled PHP cannot generate PNG images under Linux

Source: Internet
Author: User
Environment:
CentOS 6.4 64-bit
Nginx 1.4.2
PHP 5.4.7
GD library information is as follows:
GD Support Enabled
GD Version bundled (2.0.34 compatible)
FreeType Support Enabled
FreeType Linkage with FreeType
FreeType Version 2.3.11
GIF Read Support Enabled
GIF Create Support Enabled
JPEG Support Enabled
Libjpeg Version 6b
PNG Support Enabled
LibPNG Version 1.2.49
WBMP Support Enabled
XPM Support Enabled
XBM Support Enabled

Directive Local Value Master value
Gd.jpeg_ignore_warning 0 0


Now this is the case, I have a need to generate a verification code page, the use of someone else to write a code to generate codes, this code on my computer run well, on the server will appear without output image data, image handle is by Imagecreatetruecolorfunction generation, I use Var_dump to print this crank to display this information: resource (in) of type (GD)
It is clear that the handle was created, and then the generated code called these graphical functions:
imagecolorallocate
Imagefilledrectangle
Imagettftext
Imageline

Last use
header (' content-type:image/png ')
With
imagepngfunction input Verification Code image

Finally, I found through the browser side of the debugger, although the image/png type, but there is no valid data, that is, the successful invocation of the ImagecreatetruecolorAfter the image handle has been generated, the remaining graphics functions do not write any graphics data to the image.

Now the problem is that I have to have the ability to generate verification code, including the Discuz forum to be built later will have a verification code, what can I do to make this thing work.
Since GD lacked freetype support I have recompiled PHP. I now seem to be only 1). Find out why the write graph input failed and then resolve it. 2). Re-engage another version of PHP to compile.
Would you please tell me how to do it?


Reply to discussion (solution)

Post your code to verify that your program is writing without problems
If you are looking for a problem in a number of factors to determine, you should first use the exclusion method

Path, Case ...

Did the landlord solve the problem? I have also encountered this problem, but I am the CentOS installed with Yum, GD library these are the same as you

  • Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.