1.9 PHP动态扩展模块安装

[亡魂溺海] 提交于 2020-03-02 13:16:16

1.9 PHP动态扩展模块安装

/usr/local/php/bin/php -m //查看模块
下面安装一个redis的模块:
cd /usr/local/src/
wget https://codeload.github.com/phpredis/phpredis/zip/develop
mv develop phpredis-develop.zip
unzip phpredis-develop.zip
cd phpredis-develop
/usr/local/php/bin/phpize //生成configure文件
./configure --with-php-config=/usr/local/php/bin/php-config
make && make install
/usr/local/php/bin/php -i |grep extension_dir //查看扩展模块存放目录,我们可以在php.ini中去自定义该路径
vim /usr/local/php/etc/php.ini //增加一行配置(可以放到文件最后一行)
extension = redis.so

编辑配置:

[root@Dasoncheng ~]# cd /usr/local/src/
[root@Dasoncheng src]# wget https://codeload.github.com/phpredis/phpredis/zip/develop
[root@Dasoncheng src]# mv develop phpredis-develop.zip
[root@Dasoncheng src]# unzip phpredis-develop.zip 
-bash: unzip: command not found
[root@Dasoncheng src]# yum install -y unzip
[root@Dasoncheng src]# unzip phpredis-develop.zip 
[root@Dasoncheng src]# cd phpredis-develop/
[root@Dasoncheng phpredis-develop]# /usr/local/php/bin/phpize 
Configuring for:
PHP Api Version:         20131106
Zend Module Api No:      20131226
Zend Extension Api No:   220131226
Cannot find autoconf. Please check your autoconf installation and the
$PHP_AUTOCONF environment variable. Then, rerun this script.
[root@Dasoncheng phpredis-develop]# yum install -y autoconf
[root@Dasoncheng phpredis-develop]# /usr/local/php/bin/phpize 
Configuring for:
PHP Api Version:         20131106
Zend Module Api No:      20131226
Zend Extension Api No:   220131226
[root@Dasoncheng phpredis-develop]# echo $?
0
[root@Dasoncheng phpredis-develop]# ./configure --with-php-config=/usr/local/php/bin/php-config
……
[root@Dasoncheng phpredis-develop]# echo $?
0
[root@Dasoncheng phpredis-develop]# make && make install
……
See any operating system documentation about shared libraries for
more information, such as the ld(1) and ld.so(8) manual pages.
----------------------------------------------------------------------

Build complete.
Don't forget to run 'make test'.

Installing shared extensions:     /usr/local/php/lib/php/extensions/no-debug-zts-20131226/
[root@Dasoncheng phpredis-develop]# ls /usr/local/php/lib/php/extensions/no-debug-zts-20131226/
opcache.so  redis.so
[root@Dasoncheng phpredis-develop]# /usr/local/php/bin/php -m |grep redis
[root@Dasoncheng 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
[root@Dasoncheng phpredis-develop]# vim /usr/local/php/etc/php.ini 
[root@Dasoncheng phpredis-develop]# /usr/local/php/bin/php -m |grep redis
redis

至此,php扩展模块已经安装完成!谢谢

apache开启压缩 http://www.aminglinux.com/bbs/thread-5528-1-1.html
apache2.2到2.4配置文件变更 http://www.aminglinux.com/bbs/thread-7292-1-1.html
apache options参数 http://www.aminglinux.com/bbs/thread-1051-1-1.html
apache禁止trace或track防止xss http://www.aminglinux.com/bbs/thread-1045-1-1.html
apache 配置https 支持ssl http://www.aminglinux.com/bbs/thread-1029-1-1.html

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!