下载redis
wget http://download.redis.io/redis-stable.tar.gz
tar xzf redis-stable.tar.gz
cd redis-stable
make
安装依赖(一般来说不需要,不过被我碰到了,redis本身就不想依赖其他软件包)
TCL
wget http://downloads.sourceforge.net/tcl/tcl8.6.1-src.tar.gz
sudo tar xzvf tcl8.6.1-src.tar.gz -C /usr/local/
cd /usr/local/tcl8.6.1/unix/
sudo ./configure
sudo make
sudo make install
回到redis 文件夹
cd redis-stable
cd src/
make install
make test
redis-server Redis 服务器
redis-cli Redis 命令行客户端
redis-benchmark Redis 性能测试工具
redis-check-aof AOF 文件修复工具
redis-check-dump RDB文件检查工具
启动
redis-server
Redis服务器默认会使用6379端口①,通过--port参数可以自定义端口号:
redis-server --port 6380
redis-server /etc/redis.conf
关闭
redis-cli SHUTDOWN
安装扩展redis的php扩展
下载phpredis
tar -zxvf phpredis.tar.gz
cd phpreids
phpize
./configure -with-php-config=/usr/bin/php-config
make && make install
完成之后会提示
Installing share extensions:
/usr/lib/php5/20100525+lfs/
修改php.ini添加(看了很多都没讲下面的扩展路径地址怎么来的,搞的配置当天极度失落怀疑人品智商。其实这个路径是上面make install 之后会提示的)
extension=
/usr/lib/php5/20100525+lfs/redis.so
重起apapche
________________________________________________________________________________________________________________________________
________________________________________________________________________________________________________________________________
UBUNTU12.04 Redis 安装命令指南
git clone https://github.com/nicolasff/phpredis.git
sudo apt-get install git
git clone https://github.com/nicolasff/phpredis.git
ls
cd phpredis/
phpize
sudo apt-get install php5-dev
./configure --with-php-config=/usr/local/php/bin/php-config
ls
make
find / -name php-config
sudo find / -name php-config
./configure --with-php-config=/usr/bin/php-config
ls
make && make install
sudo make && make install
make test
sudo make && make install
sudo chmod -R 777 /usr/lib/php5/20090626/
sudo vi /etc/php5/apache2/php.ini
打开它,编辑进入:extension = "/usr/lib/php5/20090626/ redis.so"
git clone https://github.com/nicolasff/phpredis.git
sudo apt-get install git
git clone https://github.com/nicolasff/phpredis.git
ls
cd phpredis/
phpize
sudo apt-get install php5-dev
./configure --with-php-config=/usr/local/php/bin/php-config
ls
make
find / -name php-config
sudo find / -name php-config
./configure --with-php-config=/usr/bin/php-config
ls
make && make install
sudo make && make install
make test
sudo make && make install
sudo chmod -R 777 /usr/lib/php5/20090626/
sudo vi /etc/php5/apache2/php.ini
打开它,编辑进入:extension = "/usr/lib/php5/20090626/ redis.so"