php动态安装扩展
下面以安装phpredis扩展为例
下载扩展源码,解压
[ ~]# wget phpredis-5.1.1.tar.gz [ ~]# tar -zxf phpredis-5.1.1.tar.gz
进入源码目录,运行phpize,用来生成configure文件,如果配置了环境变量,可以直接运行phpize,否则,需要使用完整路径
[ ~]# cd xxx [ phpredis-5.1.1]# phpize或者[ phpredis-5.1.1]# /usr/local/php7/bin/phpize
执行configure
[ phpredis-5.1.1]# ./configure --with-php-config=/usr/local/php7/bin/php-config
执行make && make install开始安装
[ phpredis-5.1.1]# make && make install
安装完成后会输出扩展安装的路径,编辑php.ini,最后一行加入extension = ‘扩展路径‘
[ phpredis-5.1.1]# vim /usr/local/php7/etc/php.ini [redis] extension = ‘/usr/local/php7/lib/php/extensions/no-debug-non-zts-20180731/redis.so‘
最后重启php-fpm,php -m 模块存在就说明安装成功
相关推荐
savorTheFlavor 2020-10-23
zyyjay 2020-11-09
xuebingnan 2020-11-05
samtrue 2020-11-22
stefan0 2020-11-22
yifangs 2020-10-13
songshijiazuaa 2020-09-24
hebiwtc 2020-09-18
天步 2020-09-17
83911535 2020-11-13
whatsyourname 2020-11-13
zhouyuqi 2020-11-10
Noneyes 2020-11-10
mathchao 2020-10-28
王志龙 2020-10-28
wwwsurfphpseocom 2020-10-28
diskingchuan 2020-10-23