1. Update macports first, and then install redis
Sudo port selfupdate
Sudo port upgrade outdated
Sudo port install redis
// Start redis Server
Sudo redis-Server
// Disable redis Server
Sudo pkill-9 redis-Server
2. Install redis extension for PHP
CD/usr/local
Sudo mkdir SRC
CD/usr/local/src
Sudo mkdir phpredis-build
CD phpredis-build
Sudo git clone -- depth 1 https://github.com/nicolasff/phpredis.git
CD phpredis
Sudo phpize
Sudo./configure
Sudo make
Sudo make install
3. Add the generated redis. So to PhP. ini.
For example:
Extension =/Usr/lib/PHP/extension/ no-debug-non-zts-20100525/Redis. So
After Apache or nginx is started, use phpinfo to view the following information:
650) This. width = 650; "src =" http://s3.51cto.com/wyfs02/M01/45/57/wKioL1PnspLSvd6FAADmiXElNRk677.jpg "Title =" screen shot at 1.51.50 am.png "alt =" wkiol1pnsplsvd6faadmixelnrk677.jpg "/>
This article is from the roket space blog, please be sure to keep this source http://roketruan.blog.51cto.com/5114948/1538405