mamp pro安装redis扩展 各个步骤
Posted 风小可
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了mamp pro安装redis扩展 各个步骤相关的知识,希望对你有一定的参考价值。
1,先在mamp面板中查看php版本:7.1.8
2,~ sunny$cd /Applications/MAMP/bin/php/php7.1.8
3,git clone https://github.com/nicolasff/phpredis.git
4,php7.1.8 sunny$ls
bin conf include lib modules phpredis
5,phpredis sunny$/Applications/MAMP/bin/php/php7.1.8/bin/phpize
Configuring for:
PHP Api Version: 20160303
Zend Module Api No: 20160303
Zend Extension Api No: 320160303
Cannot find autoconf. Please check your autoconf installation and the
$PHP_AUTOCONF environment variable. Then, rerun this script.
注意:因为提示 Cannot find autoconf. 所以需要先安装:
phpredis sunny$brew install autoconf
==> Downloading https://mirrors.ustc.edu.cn/homebrew-bottles/bottles/autoconf-2.69.high_sierra.bot
######################################################################## 100.0%
==> Pouring autoconf-2.69.high_sierra.bottle.4.tar.gz
==> Caveats
Emacs Lisp files have been installed to:
/usr/local/share/emacs/site-lisp/autoconf
==> Summary
?? /usr/local/Cellar/autoconf/2.69: 71 files, 3.0MB
安装后再重新执行:
phpredis sunny$/Applications/MAMP/bin/php/php7.1.8/bin/phpize
Configuring for:
PHP Api Version: 20160303
Zend Module Api No: 20160303
Zend Extension Api No: 320160303
phpredis sunny$
6,phpredis sunny$./configure --with-php-config=/Applications/MAMP/bin/php/php7.1.8/bin/php-config
checking for grep that handles long lines and -e... /usr/bin/grep
checking for egrep... /usr/bin/grep -E
checking for a sed that does not truncate output... /usr/bin/sed
checking for cc... cc
7,phpredis sunny$make
/bin/sh /Applications/MAMP/bin/php/php7.1.8/phpredis/libtool --mode=compile cc -I. -I/Applications/MAMP/bin/php/php7.1.8/phpredis -DPHP_ATOM_INC -I/Applications/MAMP/bin/php/php7.1.8/phpredis/include -I/Applications/MAMP/bin/php/php7.1.8/phpredis/main -I/Applications/MAMP/bin/php/php7.1.8/phpredis -I/Applications/MAMP/bin/php/php7.1.8/include/php -I/Applications/MAMP/bin/php/php7.1.8/include/php/main -I/Applications/MAMP/bin/php/php7.1.8/include/php/TSRM -I/Applications/MAMP/bin/php/php7.1.8/include/php/Zend -I/Applications/MAMP/bin/php/php7.1.8/include/php/ext -I/Applications/MAMP/bin/php/php7.1.8/include/php/ext/date/lib -DHAVE_CONFIG_H -g -O2 -c /Applications/MAMP/bin/php/php7.1.8/phpredis/redis.c -o redis.lo
8,phpredis sunny$make test
Build complete.
Don‘t forget to run ‘make test‘.
9,打开 MAMP,在左上角 File 菜单-> Edit Template-> PHP-> 7.1.8 版本打开 php.ini 中找到 Dynamic Extensions 区域添加扩展:extension=redis.so
10,将 php7.1.8/phpredis/modules/redis.so 复制到 php.ini 中 extension_dir = "/Applications/MAMP/bin/php/php7.1.8/lib/php/extensions/no-debug-non-zts-20160303/" 里面。
11,启动redis :phpredis sunny$redis-server
以上是关于mamp pro安装redis扩展 各个步骤的主要内容,如果未能解决你的问题,请参考以下文章
从过期的 MAMP Pro 试用版迁移到 MAMP 的免费版 (OSX) 后显示 Wordpress 安装页面
用于多个 wordpress 安装的 MAMP Pro 连接错误
将 Coda 连接到由 Mamp Pro 托管的本地 Wordpress 安装