The self-compiled php cannot generate a PNG image environment in linux:
CentOS 6.4 64-bit
Nginx 1.4.2
PHP 5.4.7
The 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
This is the case now. I have a page for generating a verification code that uses a code written by someone else to generate the verification code. this code runs well on my local machine, when put on the server, there will be no output image data, and the image handle is
ImagecreatetruecolorFunction generation. I use var_dump to print the crank and display the following information: resource (55) of type (gd)
Obviously, the handle is created. the generated code then calls these graphic functions:
Imagecolorallocate
Imagefilledrectangle
Imagettftext
Imageline
Last use
Header ('content-type: image/png ')
Cooperation
ImagepngFunction input verification code Image
Finally, I found through the browser-side debugger that, although it is of the image/png type, there is no valid data, that is, after the successful call
ImagecreatetruecolorAfter the image handle is generated, other graphic functions do not write any graphic data to the image.
The problem now is that I must have the verification code generation function, including the verification code for the discuz Forum to be created later. how can I do this to make it work.
Due to the lack of freetype support in GD, I have re-compiled PHP. I can only 1 ). find out the cause of invalid input of the written image and solve the problem. 2 ). compile another version of PHP.
Please tell me how to change it.
Reply to discussion (solution)
Paste your code to verify that your program writing is correct
If you locate the problem among multiple identified factors, you should first use exclusion
Path, case ......
Have you solved the problem? I also encountered this problem, but I installed centos with yum. the gd Library is the same as yours.