Recently, I switched the development environment from Windows to Mac, and all environments have to be reconfigured. Since Mac is based on a Unix system and I am not familiar with it, I encountered many problems. The editor will sort out and share them with you below.
Install the phpredis extension:
First, everyone downloads the phpredis extension package. This is the address https://nodeload.github.com/nicolasff/phpredis/zip/master (it is recommended that you download it manually and then copy it).
Secondly, everyone uses the command to enter the folder
cd phpredis-master/ phpize命令(命令可能会出问题,解决方法请见文章尾部) ./configure --with-php-config=/usr/bin/php-config make sudo make install (依次执行上面的命令) # 这时候会提示一个路径 # /usr/lib/php/extensions/no-debug-non-zts-20100525/ # 表示已经将扩展放置在该位置 vim /etc/php.ini #增加如下内容 extension=redis.so #重启apache sudo apachectl restart #查看扩展安装情况 php -m |grep redis #出现 redis 表示安装成功
The above is the complete introduction to installing the phpredis extension on Mac. I hope you like it.
For more related articles on how to install phpredis extension on Mac, please pay attention to PHP Chinese website!