Как установить расширение memcache (php72, macos Catalina) - PullRequest
0 голосов
/ 17 января 2020

Я не могу установить расширение memcache (не memcached) на MacOs Catalina, php 7.2

checking for the location of zlib... configure: error: memcache support requires ZLIB. Use --with-zlib-dir=<DIR> to specify prefix where ZLIB include and library are located
ERROR: `/private/tmp/pear/temp/memcache/configure --with-php-config=/usr/local/opt/php@7.2/bin/php-config --enable-memcache-session=yes' failed

Я пытаюсь

pecl install memcache --with-zlib-dir=/usr/local/Cellar/zlib/1.2.11/include/zlib.h

Но

Attempting to discover channel "--with-zlib-dir=/usr/local/Cellar/zlib/1.2.11/include"...
Attempting fallback to https instead of http on channel "--with-zlib-dir=/usr/local/Cellar/zlib/1.2.11/include"...
unknown channel "--with-zlib-dir=/usr/local/Cellar/zlib/1.2.11/include" in "--with-zlib-dir=/usr/local/Cellar/zlib/1.2.11/include/zlib.h"
invalid package name/package file "--with-zlib-dir=/usr/local/Cellar/zlib/1.2.11/include/zlib.h"

1 Ответ

1 голос
/ 21 января 2020

Вы близки ... Ваш путь должен быть не заголовочным файлом, а каталогом. Кроме того, pecl install не передает параметр командной строки в сценарии команде ./configure, поэтому вы должны сделать это самостоятельно:

pecl download memcache
open memcache-4.0.5.2.tgz  
cd memcache-4.0.5.2/memcache-4.0.5.2
phpize
./configure --with-zlib-dir=/usr/local/Cellar/zlib/1.2.11
make
sudo make install
...