update install-phpredis.sh

This commit is contained in:
Guobao Jiang 2014-03-07 10:06:02 +08:00
parent 49c2426468
commit bd97be20df
1 changed files with 19 additions and 10 deletions

View File

@ -3,24 +3,33 @@
# install phpredis
#############################################
sudo apt-get install autoconf
## step 1. install depends auto conf
sudo apt-get install autoconf ## for ubuntu
## yum install autoconf ## for rhel and centos
## step 2. download source code
wget https://github.com/nicolasff/phpredis/tarball/master
## step 3. configure, compile and install
cd src
~/php5/bin/phpize
./configure --with-php-config=/home/vagrant/php5/bin/php-config
make
make install
## then add two lines in php5/etc/php.in
## step 4. setting php.ini, add follow two lines in php5/etc/php.ini
# extension=redis.so
# extension_dir = "/home/aborn/php5/lib/php/extensions/no-debug-non-zts-20121212"
## if occurs
## Fatal error: Class 'redis' not found
## step 5. if possible
## if occurs
## Fatal error: Class 'redis' not found
## during using class redis,
## please use follow in php code
if (!extension_loaded('redis')) {
##echo "no load!";
if (!dl('redis.so')) {
exit;
}
}
# if (!extension_loaded('redis')) {
# ##echo "no load!";
# if (!dl('redis.so')) {
# exit;
# }
#}