一.安裝redis擴展php
下載redis擴展包以及解壓node
wget https://github.com/edtechd/phpredis/archive/php7.zip unzip php7.zip
進入解壓後目錄,編譯安裝git
cd data/pkg/phpredis-php7
/usr/local/php/bin/phpize
出現問題github
Cannot find autoconf. Please check your autoconf installation and the $PHP_AUTOCONF environment variable. Then, rerun this script. #安裝autoconf yum install autoconf
開始編譯redis
/usr/local/php/bin/phpize
查找php-configvim
find / -name php-config
配置環境swoole
./configure --with-php-config=/usr/local/php/bin/php-config
編譯安裝php7
make & make install
配置php.ini,添加redis.so擴展php-fpm
vim /usr/local/php/etc/php.ini
extension=redis.so
重啓php-fpmthis
killall php-fpm
/usr/local/sbin/php-fpm
二.安裝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
以上就是php編譯安裝擴展redis及swoole的詳細內容,更多PHP相關知識請關注個人專欄PHP