简体   繁体   中英

MAMP install Redis extension on Mac

How do I install an extension on MAMP (not PRO)?

I have edited my .zshrc file to add:

export PATH=/Applications/MAMP/Library/bin:/Applications/MAMP/bin/php/php7.2.10/bin:/usr/local/bin:$PATH:/opt/local/bin

When I run php --ini I get this:

Configuration File (php.ini) Path: /Applications/MAMP/bin/php/php7.2.10/conf

Loaded Configuration File: /Applications/MAMP/bin/php/php7.2.10/conf/php.ini

Scan for additional .ini files in: (none)

Additional .ini files parsed: (none)

However when I do any changes in that php.ini file, I see no changes as if some "global" changes overwrite it. I tried invalidating the ini by adding gibberish to it, but I got no error. After each change I do a MAMP stop/start, and PHP cache is set to 'off'.

Since I had redis.so from before, I have manually moved it to extension folder, but pecl install redis fails with this message:

downloading redis-4.2.0.tgz ...
Starting to download redis-4.2.0.tgz (235,569 bytes)
.................................................done: 235,569 bytes
25 source files, building
running: phpize
Configuring for:
PHP Api Version:         20170718
Zend Module Api No:      20170718
Zend Extension Api No:   320170718
autom4te: need GNU m4 1.4 or later: /Applications/MAMP/Library/bin/m4
ERROR: `phpize' failed

But phpize -v returns

Configuring for:
PHP Api Version:         20170718
Zend Module Api No:      20170718
Zend Extension Api No:   320170718

I have autoconf installed.

I have resolved the issue. The main problem was in PECL/PEAR paths. Once I did this:

pear config-set php_ini /Applications/MAMP/bin/php/php7.2.10/conf/php.ini
pecl config-set php_ini /Applications/MAMP/bin/php/php7.2.10/conf/php.ini

The issue was resolved

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM