码迷,mamicode.com
首页 > 其他好文 > 详细

mamp pro安装redis扩展 各个步骤

时间:2019-03-04 14:18:45      阅读:593      评论:0      收藏:0      [点我收藏+]

标签:har   mpi   .gz   --   版本   执行   ott   lis   hat   

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扩展 各个步骤

标签:har   mpi   .gz   --   版本   执行   ott   lis   hat   

原文地址:https://www.cnblogs.com/xkfeng/p/10470318.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!