PHP imagepng Function issues

Source: Internet
Author: User
Tags phpinfo

About PHP cannot use imagepng function, cause nginx 502 problem

Some of the wrong understandings:
1. libpng version low, this is not, and the version is not related

First of all to check yourself, phpinfo () there is a GD library support, if you have to see Phpinfo ()--with-png-dir=/usr/local/libpng.1.6.19, and then look at the PHP dependency library, with this:

ldd/usr/local/php/bin/php | grep libpng

What I see is this:

libpng12.so.0 =/usr/lib/x86_64-linux-gnu/libpng12.so.0 (0x00007fa6dbbe2000)
libpng12.so.0, in fact, is that the libpng version is 1.2.x.

Obviously libpng.1.6.19 and libpng.1.2.x are not right, the problem is here, the solution is:
1. Upgrade the LIBPNG12 version of/usr/lib/x86_64-linux-gnu/libpng12.so.0 to Libpng16, install-y Libpng16-dev with Apt-get, and recompile PHP.
2. The original/usr/local/libpng.1.6.19 deleted, recompile installation libpng, to use 1.2.x version, here will not repeat libpng installation, the path will be written to--with-png-dir= can be, and then recompile PHP.

Resources:

https://www.huangdc.com/533

PHP imagepng Function issues

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.