Installing PHP Extensions

Source: Internet
Author: User
Tags install redis

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
    1. 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

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.