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