PHP Expansion Module Installation

Source: Internet
Author: User
Tags install php

PHP Expansion Module Installation

When we install PHP we may forget to install some modules, or need to add modules when we can use the expansion module installation.
See which modules are loaded by PHP, use commands
/usr/local/php/bin/php -m

Install the Redis module under the demo below
CD into the installation download directory
cd /usr/local/src/

Download a Redis Package
wget https://codeload.github.com/phpredis/phpredis/zip/develop

Change the name of the package
mv develop phpredis-develop.zip

Unpack the Package
unzip phpredis-develop.zip

CD into the unpacked package directory
cd phpredis-develop/

Then we need to do a phpize operation, because we want to build the Configure file, because we want to compile it requires configure file, and its package does not, (may be error, less a package, we pre-yum install this package)
yum install -y autoconf

Generate Configure File
/usr/local/php/bin/phpize

To compile
./configure --with-php-config=/usr/local/php/bin/php-config
make
make install

View the storage directory of the extension module
usr/local/php/bin/php -i |grep extension_dir

Add a line to the PHP configuration file
vim /usr/local/php/etc/php.ini

To search for a keyword after opening the configuration file:extension=php
Add a line to the last face:
extension=redis.so

Then we check to see if loading
/usr/local/php/bin/php -m |grep redis

Showing Redis is the load

PHP Expansion Module Installation

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.