Home > Article > Backend Development > [Redis] Install and test redis under centos centos php redis centos centos7 redis installation
Download the software, use the command wget xxx, parameters: url
For example:
wget http://download.redis.io/releases/redis-3.0.0.tar.gz
Unzip, use the command tar, parameters :zxvf z (gzip attribute), Unzip the directory and install
cd redis-3.0.0
make
The installation is now complete. Go to the directory src and start redis
redis-server
Open the client and test it, still src Directory, start the client
redis-cli
Enter the redis control panel, use the command set get to test
set name taoshihan
get name
To run external network access, first temporarily close the firewall or, or open the firewall 6379 Port
Close the firewall: service iptables stop
Modify the firewall rules: edit the /etc/sysconfig/iptables file
You can copy the configuration of other ports and change it, add a line -A INPUT -p tcp -m tcp --dport 6379 - j ACCEPT
php test
Windows system download php extension file
Download address: http://windows.php.net/downloads/pecl/releases/redis/2.2.7/php_redis-2.2.7-5.6-ts -vc11-x64.zip
Put php_redis.dll in the ext directory, modify php.ini
Add extension=php_redis.dll
<?<span>php </span><span>//</span><span> 连接到redis</span><span>$redis</span>=<span>new</span><span> Redis(); </span><span>$redis</span>->connect('192.168.1.113', 6379<span>); </span><span>$redis</span>->set("name","小雪狼"<span>); </span><span>echo</span><span>$redis</span>->get("name"<span>); </span>?>
The above introduces [Redis] redis installation and testing under centos, including centos and redis content. I hope it will be helpful to friends who are interested in PHP tutorials.