We often run into the compiler after the installation of PHP and then remembered to add an extension, the last time our company's PHP encountered a situation like this, We upgraded PHP from 5.3.3 to 5.6.8, and then recompile, 5.6.8 installation is complete, but they do not have the GD Library of PHP, can not identify the verification code, then my egg hurts, can only continue to install the extension. But for a moment to forget how to install the extension, re-download a gd.tar.gz source code compilation is not good, fortunately later found their own documents, and now this method is posted for reference later.
PHP Extract Directory/data/php-5.6.8php installation directory/data/install/php
Installing GD extensions
Before the installation of GD to install a few other packages, or the GD library compile time will be error, if you have installed a few other packages, you can omit the following 1, 2 steps, if there are errors can be based on the error prompt to repair
① installation freetype [[email protected] ~]# tar xzvf /data/install/freetype-2.4.0.tar.gz [[email protected] ~]# cd /data/install/freetype-2.4.0 [[email protected] ~]# make && make install ② installation jpeg [[email protected] ~]# tar xzvf /data/install/jpegsrc.v6b.tar.gz [[email protected] ~]# cd /data/install/jpeg-6b [[email protected] ~]# make && make install ③ installation gd [[email protected] ~]# cd /data/install/php-5.6.8 [[email protected] Php-5.6.8]# cd ext/gd/
The default is no configure, we need to execute the phpize command in the PHP installation directory [[ email protected]_qx_web gd]# /data/install/php/bin/phpize The configure [[email protected] gd]# ./configure --will not appear until this command is executed. with-php-config=/data/install/php/bin/php-config --with-png-dir --with-freetype-dir -- with-jpeg-dir --with-gd [[email protected] gd]# make && make install [[email protected] gd]# echo "extension = gd.so " >> /data/install/php/etc/php.ini [[email Protected] gd]# service php-fpm restart
2. Install Redis extensions [[email protected] ~]# tar zxvf redis-2.2.7.tgz [[email protected] ~]# CD redis-2.2.7 [email Protec Ted] ~]#/usr/local/php/bin/phpize [[email protected] ~]#./configure--with-php-config=/data/install/php/bin/php-c onfig [[email protected] ~]# make && make install [[email protected] ~]# echo "extension = redis.so" >&G T /data/install/php/etc/php.ini [[Email protected] ~]# service PHP-FPM restart
The above is my installation of GD and Redis extension process, the basic compilation after PHP to append the extension is basically this step.
This article is from the "Chuck's blog" blog, so be sure to keep this source http://chuckzeng.blog.51cto.com/10524728/1752819
Installing PHP Extensions