且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

如何在MacOS High Sierra上为php@7.1安装memcached模块?

更新时间:2023-02-23 15:15:43

  1. pecl bundle memcached
  2. 更改为输出目录
  3. phpize
  4. 确保已安装libmemcached和zlib(brew install libmemcached zlib)
  5. 获取zlib目录(brew list zlib)
  6. ./configure --with-zlib-dir=/usr/local/Cellar/zlib/1.2.11/(用上一个命令中的zlib路径替换zlib路径)
  7. make
  8. make install
  9. 在您的php.ini文件中添加扩展行(例如,更改路径以匹配make install输出.我将其添加到我的/usr/local/etc/php/7.4/conf.d目录中名为ext-memcached.ini的文件中
  1. pecl bundle memcached
  2. Change to the directory it output
  3. phpize
  4. Make sure libmemcached and zlib are installed (brew install libmemcached zlib)
  5. Get the zlib directory (brew list zlib)
  6. ./configure --with-zlib-dir=/usr/local/Cellar/zlib/1.2.11/ (replace the zlib path with the one from the previous command)
  7. make
  8. make install
  9. Add the extension line in your php.ini file (ex. change the paths to match what make install output. I added this to my /usr/local/etc/php/7.4/conf.d directory in a file called ext-memcached.ini

[memcached] extension=memcached.so

[memcached] extension=memcached.so

  1. 验证您已安装模块php -m应该在输出列表中显示memcached
  1. Verify you installed the module php -m should show you memcached in the outputted list