Phpredis
- Introduced
- Mac installation Steps
- Installing Redis
- Installing Phpredis
- Sample code
Introduced
Redis
is a high-performance Key-value database.
Redis
Clients such as Java,c/c++,c#,php,javascript,perl,object-c,python,ruby,erlang are provided.
- Now, let's talk about
<如何在Mac上安装PhpRedis>
Mac installation steps to install Redis
- Download
Redis
Address http://download.redis.io/releases/redis-3.0.3.tar.gz
Compile and start (execute the following command sequentially in the unpacked directory)
Make sudo Make Install Redis-server
Test
shell$ redis-cli 127.0.0.1:6379> set name zergling OK 127.0.0.1:6379> get name "zergling"
Installing Phpredis
- Download First
PhpRedis
GitHub Address: Https://github.com/nicolasff/phpredis
Compile the installation (execute the following command sequentially in the unpacked directory)
默认php环境
phpize . /configure--with-php-config=/usr/bin/php-config sudomake sudo makeInstall
xampp环境
(Modify the corresponding PHP command path)
/applications/xampp/xamppfiles/bin/phpize . /configure--with-php-config=/applications/xampp/xamppfiles/bin/php-config sudo make sudomakeinstall
The phpize
following error may occur when executing
Cannot find autoconf. Please check your autoconf installation and the $PHP_AUTOCONF environment variable.
Workaround (Installed brew
direct execution of the second sentence)
" $ (curl-fssl https://raw.github.com/Homebrew/homebrew/go/install) " Install autoconf
Modifyphp.ini
/ect/php.ini
(Default environment)
/Applications/XAMPP/xamppfiles/etc/php.ini
(XAMPP Environment)
At the end of the add
extension=redis.so
Restart Apache
Verify
php-m | grep /applications/xampp/bin/php-m | grep Redis
Appears to redis
indicate successful installation
Sample code
<? PHP $redis New Redis (); $redis->connect (' 127.0.0.1 ', 6379); $redis->set (' name ', ' zergling '); Echo $redis->get (' name ');
This site article is for baby bus SD. Team Original, reproduced must be clearly noted: (the author's official website: Baby bus )
Reprinted from "Baby bus Superdo Team" original link: http://www.cnblogs.com/superdo/p/4726430.html
[PHP plugin tutorial]003.phpredis