ale*_*ius 9 php macos memcached macos-high-sierra
我有问题为php 7.1安装memcached的模块.我使用MacOS High Sierra和php@7.1使用自制软件安装.在使用命令安装memcached模块for php期间
pecl install memcached
我收到了错误:
检查zlib位置... configure:错误:memcached支持需要ZLIB.使用--with-zlib-dir =指定ZLIB头和库所在的前缀ERROR:`/ private/tmp/pear/install/memcached/configure --with-php-config =/usr/local/opt/php@7.1/bin/php-config --with-libmemcached-dir'失败了
但我已经安装了zlib.在homebrew存储库中进行更改后,我找不到如何安装memcached模块的方法.
Rya*_*ews 22
pecl bundle memcachedphpizebrew list zlib)./configure --with-zlib-dir=/usr/local/Cellar/zlib/1.2.11/ (将zlib路径替换为上一个命令中的路径)makemake install/usr/local/etc/php/7.0/conf.d directory in a file called ext-memcached.ini[memcached]
extension=/usr/local/Cellar/php@7.0/7.0.30_1/pecl/20151012/memcached.so
php -m应该在输出列表中显示memcached您可以使用 env 变量PHP_ZLIB_DIR来告诉它 zlib 在哪里。
PHP_ZLIB_DIR=/usr/local/opt/zlib pecl install memcached
Run Code Online (Sandbox Code Playgroud)
完整安装。
brew install zlib
yes no | PHP_ZLIB_DIR=$(brew --prefix zlib) pecl install memcached
Run Code Online (Sandbox Code Playgroud)