php环境篇:php编译安装扩展redis及swoole
1.安装redis扩展
下载redis扩展包以及解压
wget https://github.com/edtechd/phpredis/archive/php7.zip unzip php7.zip
进入解压后目录,编译安装
cd data/pkg/phpredis-php7 /usr/local/php/bin/phpize
出现问题
Cannot find autoconf. Please check your autoconf installation and the $PHP_AUTOCONF environment variable. Then, rerun this script. #安装autoconf yum install autoconf
开始编译裤子韩
/usr/local/php/bin/phpize
查找php-config
find / -name php-config
配置环境
./configure --with-php-config=/usr/local/php/bin/php-config
编译安装
make & make install
配置php.ini,添加redis.so扩展
vim /usr/local/php/etc/php.ini extension=redis.so
重启php-fpm
killall php-fpm /usr/local/sbin/php-fpm
2.安装swoole扩展
克隆swoole
git clone https://gitee.com/swoole/swoole.git
安装swoole,且编译
cd swoole /usr/local/php/bin/phpize ./configure --with-php-config=/usr/local/php/bin/php-config make && make install
配置php.ini,添加swoole.so扩展
vim /usr/local/php/etc/php.ini extension=swoole.so
重启php-fpm
killall php-fpm /usr/local/sbin/php-fpm
相关推荐
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