php添加phpredis扩展方法步骤
程序员文章站
2022-03-29 20:49:27
redis安装上篇文章已经讲过
1、先下载phpredis
wget https://codeload.github.com/phpredis/phpredis/zip/d...
redis安装上篇文章已经讲过
1、先下载phpredis
wget https://codeload.github.com/phpredis/phpredis/zip/develop
2、解压develop
unzip develop ll drwxr-xr-x 11 root root 4096 10月 23 14:11 phpredis-develop
3、编译安装
cd phpredis-develop /usr/local/php/bin/phpize ./configure --with-php-config=/usr/local/php/bin/php-config make && make install
install之后redis.so 文件安装在/usr/local/php/lib/php/extensions/no-debug-non-zts-20151012文件之中
4、配置php.ini文件
echo extension_dir = "/usr/local/php/lib/php/extensions/no-debug-non-zts-20151012" >> /usr/local/php/etc/php.ini echo extension=redis.so >> /usr/local/php/etc/php.ini
5、重启nginx 或者apache,我安装的是nginx
/usr/local/nginx/sbin/nginx -s reload
6、查看是否添加成功
php -m
查看是否已有redis
或者phpinfo();