php扩展模块安装
1、查看php模块
[root@centos7 ~]# /usr/local/php/bin/php -m
2、安装redis模块
[root@centos7 package]# wget https://codeload.github.com/phpredis/phpredis/zip/develop
3、[root@centos7 package]# mv develop phpredis-develop.zip
4、[root@centos7 package]# unzip phpredis-develop.zip
5、[root@centos7 package]# cd phpredis-develop
6、[root@centos7 phpredis-develop]# yum install -y autoconf
7、执行以下命令后生成configure文件,否则无法进行编译安装
[root@centos7 phpredis-develop]# /usr/local/php/bin/phpize
8、[root@centos7 phpredis-develop]# ./configure --with-php-config=/usr/local/php/bin/php-config
9、[root@centos7 phpredis-develop]# echo $?
0
10、[root@centos7 phpredis-develop]# make
11、[root@centos7 phpredis-develop]# make install
Installing shared extensions: /usr/local/php/lib/php/extensions/no-debug-zts-20131226/
12、PHP加载Redis模块
[root@centos7 phpredis-develop]# ls /usr/local/php/lib/php/extensions/no-debug-zts-20131226/
opcache.so redis.so
13、查看扩展模块的所在的目录
[root@centos7 phpredis-develop]# /usr/local/php/bin/php -i|grep extension_dir
extension_dir => /usr/local/php/lib/php/extensions/no-debug-zts-20131226 => /usr/local/php/lib/php/extensions/no-debug-zts-20131226
sqlite3.extension_dir => no value => no value
14、[root@centos7 phpredis-develop]# vi /usr/local/php/etc/php.ini
extension=redis.so #加入这个
15、查看模块
[root@centos7 phpredis-develop]# /usr/local/php/bin/php -m |grep redis
redis
在php中的ext目录下也有模块的安装包,若是没有的话则需要下载。安装下zip的包(安装方式和redis的模块差不多)
1、/data/package/php-5.6.30/ext/zip
2、安装方式查看上面的安装
[root@centos7 zip]# ll /usr/local/php/lib/php/extensions/no-debug-zts-20131226/
total 3248
-rwxr-xr-x 1 root root 607543 Nov 9 17:56 opcache.so
-rwxr-xr-x 1 root root 1985135 Nov 10 12:48 redis.so
-rwxr-xr-x 1 root root 726491 Nov 10 12:59 zip.so
3、
[root@centos7 zip]# /usr/local/php/bin/php -m |grep zip
zip