系統是lamp環境(centos6.7+apache2.2+mysql5.7+php5.3),預設 軟體下載到/usr/local/src目錄下 redis安裝在/app/local/redis目錄下 #wget http://download.redis.io/releases/redis-2.8 ...
系統是lamp環境(centos6.7+apache2.2+mysql5.7+php5.3),預設
軟體下載到/usr/local/src目錄下 redis安裝在/app/local/redis目錄下
#wget http://download.redis.io/releases/redis-2.8.24.tar.gz
#tar zxvf redis-2.8.24.tar.gz
#mkdir -p /app/local/redis
#cd redis-2.8.24
#make PREFIX=/app/local/redis install
啟動redis
#/app/local/redis/bin/redis-server
接著安裝phpredis擴展
#wget https://github.com/nicolasff/phpredis/archive/2.2.4.tar.gz
#tar zxvf 2.2.4.tar.gz
#cd phpredis-2.2.4
#/app/local/php/bin/phpize #生成configure配置文件
出現如下說明生成了配置文件
[root@localhost phpredis-2.2.4]# /app/local/php/bin/phpize Configuring for:
PHP Api Version: 20090626
Zend Module Api No: 20090626
Zend Extension Api No: 220090626
#./configure --with-php-config=/app/local/php/bin/php-config
#make && make install
最後生成擴展文件
Installing shared extensions: /app/local/php/lib/php/extensions/no-debug-non-zts-20090626/
接著配置php.ini
#vi /app/local/php/etc/php.ini
在extension後添加
extension=redis.so
:x
重啟apache
#/app/local/apache/bin/apachectl restart
最後在phpinfo里查看redis擴展是否載入
如下圖所示: