The first thing to say is to install the software on the Mac, the best tool is brew, it is recommended to install brew first. Do not understand the first to search for this, very easy to use. Use Ruby to install the following:
/usr/bin/ruby-e "$ (curl-fssl https://raw.githubusercontent.com/Homebrew/install/master/install)"
The PHP I use is a brew-installed PHP54, the process is as follows:
brew tap homebrew
/dupes
brew tap josegonzalez
/homebrew-php
brew
install
php54 --with-imap --with-tidy --with-debug --with-pgsql --with-mysql --with-fpm
If you are using another way to install PHP, or the system comes with PHP, replace the file location,
/usr/local/bin/php-i|grep php.ini Find INI location
Php-fpm.conf under the same folder
wget Https://nodeload.github.com/nicolasff/phpredis/zip/master
Tip No wget, first install brew, then brew install wget
TAR-ZXF Master
CD phpredis-master/
sudo phpize
Cannot find autoconf. Please check your autoconf installation
Tip No autoconf, use brew install autoconf
./configure
Make
sudo make install
# This will prompt a path
#/usr/lib/php/extensions/no-debug-non-zts-20090626/
Mine is /usr/local/cellar/php54/5.4.45_3/lib/php/extensions/debug-non-zts-20100525/ .
Indicates that an extension has been placed at that location
Add the following in the/usr/local/etc/php/5.4/php.ini:
extension= "/usr/local/cellar/php54/5.4.45_3/lib/php/extensions/debug-non-zts-20100525/redis. So"
# restart fpm Nginx
Nginx-s Reload
Killall PHP-FPM
/USR/LOCAL/CELLAR/PHP54/5.4.45_3/SBIN/PHP-FPM--daemonize--fpm-config/usr/local/etc/php/5.4/php-fpm.conf--pid/ Usr/local/var/run/php-fpm.pid-c/usr/local/etc/php/5.4/php.ini
#查看扩展安装情况
Php-m |grep Redis
#出现Redis indicates a successful installation.
Mac installation Php-redis