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