Liunx PHP's GD library to add JPEG file support

Source: Internet
Author: User

General source installation of the addition of the GD library is not supported in JPEG format pictures, only support the following format

GD Support Enabled
GD Version Bundled (2.0.34 compatible)
GIF Read Support Enabled
GIF Create Support Enabled
PNG Support Enabled
LibPNG Version 1.2.49
WBMP Support Enabled
XBM Support Enabled
Let's add support for JPEG format files

wget http://www.ijg.org/files/jpegsrc.v8b.tar.gz

TAR-ZXVF jpegsrc.v8b.tar.gz
CD jpeg-8b

./configure--prefix=/usr/local/jpeg--enable-shared--enable-static
Make && make install

Below to enter the PHP source directory under the ext of the GD directory

After entering the GD directory, note that the following/usr/local/php/is the installation path of your server PHP. Mine is the way it's written.

/usr/local/php/bin/phpize

./configure--with-php-config=/usr/local/php/bin/php-config--with-jpeg-dir=/usr/local/jpeg/

Make && make install

After executing these systems, you will be prompted to gd.so the build directory

After adding gd.so under PHP.ini, restart the PHP restart Application server and it will be OK.

Some machines may not work, so solve

Yum Install Libjpeg-devel freetype-devel libpng-devel
Make clean and then re-/configure
Make&make Install

See Phpinfo OK.

 support Version 2.0 Readsupport    Create support Support Version   support Version 1.2. Ten   support enabled

GD Support Enabled
GD Version Bundled (2.0.34 compatible)
GIF Read Support Enabled
GIF Create Support Enabled
JPEG Support Enabled
Libjpeg Version 8
PNG Support Enabled
LibPNG Version 1.2.49
WBMP Support Enabled
XBM Support Enabled

Directive Local Value Master Value
Gd.jpeg_ignore_warning 0 0

Liunx PHP's GD library to add JPEG file support

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.