PHP Add GD

Source: Internet
Author: User
Tags php source code zts zend

A GD introduction:

PHP's extended library of graphics processing provides a range of APIs for working with images. If the development process found that the page verification code can not be displayed, you should consider checking phpinfo (), whether the GD library is supported.

Two ideas:

Online discovery of the method of adding GD library, everywhere is downloaded separately libgd source method, for compiling LIBGD, also need to download a series of dependencies, quite troublesome. Used to play Wamp, remember that Gd.dll are PHP comes with. Guess, under Linux, through the PHP source code may be able to get the corresponding. so file. Sure enough, under the Php_src/ext really have GD source code.

Three versions: PHP 5.6.9

Four processes:

1: Compile build. So file

[Email protected] gd]# pwd #路径

/opt/php/php-5.6.9/ext/gd

[Email protected] gd]#. /.. /scripts/phpize #用phpize工具生成configure文件

Configuring for:

PHP Api version:20121113

Zend Module Api no:20121212

Zend Extension Api no:220121212

[Email protected] gd]#

[Email protected] gd]#/configure \

>--prefix= $HOME/install/php/\

>--with-php-config= $ (PHP installation path)/bin/php-config

[[email protected] gd]# make install

... #省略其他打印

CP./.libs/gd.so/opt/php/php-5.6.9/ext/gd/modules/gd.so #目标文件生成

CP./.libs/gd.lai/opt/php/php-5.6.9/ext/gd/modules/gd.la

Path= "$PATH:/sbin" Ldconfig-n/home/lzc/lamp/php/php-5.6.9/ext/gd/modules

----------------------------------------------------------------------

Libraries has been installed in:

/home/lzc/lamp/php/php-5.6.9/ext/gd/modules

..... #省略其他打印

Installing Shared extensions:/usr/local/lib/php/extensions/no-debug-non-zts-20131212/

Installing header files:/usr/local/include/php/

[Email protected] gd]# cp/usr/local/lib/php/extensions/no-debug-non-zts-20121312/gd.so/opt/php/lib/php/ Extensions/no-debug-non-zts-20121312/gd.so #将文件copy到自己的php安装路径下

2: Edit php.ini, add extension

Extension=/opt/php/lib/php/extensions/no-debug-non-zts-20131212/gd.so

PHP Add GD

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.