One, install Redis
1, download Redis package: wget http://download.redis.io/releases/redis-2.8.9.tar.gz
2, unpack the Redis package, enter the redis-2.8.9 directory, compile
Make first
Then make install
Finally run the Redis service-side/usr/local/bin/redis-server (service-side REDIS-CLI)
3. So far, even if the installation has been completed Redis;
(PHP does not use Redis at this time because there is no intermediate contact between PHP and Redis: Redis extension)
(Error: Fatal error:class ' Redis ' not found in/home/huyi/www.php.com/shopping/redis_goods.php to line 9)
Two, now is the installation of PHP Redis extension
1, download Address: Http://pecl.php.net/package/redis
2, select the version you want:
3. Download the file, use the RZ command to upload to the Linux machine, I upload the directory is/usr/local
4. Installation:
TAR-ZXVF redis-3.0.0.tgz
CD redis-3.0.0
/usr/local/php/bin/phpize #用phpize生成
./configure--with-php-config=/usr/local/php/bin/php-config #配置
Make
Make install
To this extended download installation complete
5, configure php.ini files so that PHP can support Redis extensions
Vim/etc/php.ini
Add this line in: Extension = redis.so
Restart service;
Test under Phpinfo (); You can now see Redis extension support;