download the software, use the command wget xxx, parameters: url
For example:
wget http://download.redis.io/releases/redis-3.0.0.tar.gz
To decompress, use the command tar, parameters: zxvf z (gzip attribute), x (decompression), v (display process), f (use file name), file name
For example:
tar zxvf redis-3.0.0.tar.gz
Switch to the unzipped 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, test, or in the src directory, start the client
redis-cli
Enter the redis control panel and use the command set get to test
set name taoshihan
get name
To access external network, first temporarily close the firewall or open port 6379 of the firewall
Turn off the firewall: service iptables stop
Modify firewall rules: edit /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
Download php extension file for windows system
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 and 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>?>