MAMP:如何安装Memcached?
我尝试使用本教程在 MAMP - Snow Leopard 10.6.2 中安装 memcached:
我顺利完成了第一步到最后一步:奖励部分:使用 MAMP 启动和停止 Memcache
之后,我在仪表板并通过 phpinfo 检查,但 memcached 扩展不存在。
你们是否在 MAMP 中成功安装了 memcached,或者您知道如何使其工作的其他方法吗?
提前致谢 :)
I have tried to install memcached in MAMP - Snow Leopard 10.6.2 using this tutorial:
Setup a Memcached-Enabled MAMP Sandbox Environment
I finished with no errors the first to the last step: Bonus Section: Start and Stop Memcache with MAMP
After that I restarted my MAMP widget in the dashboard and checked by phpinfo but the memcached extension is not there.
Do you guys successfully installed memcached in your MAMP or do you know any other way on how to make it work?
Thanks in advance :)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(5)
适用于 MAMP 的 Pecl Memcached 库始终是最新的。
这是 github 存储库: https://github.com/majksner/php-memcached-mamp
Pecl Memcached library for MAMP which is always up to date.
Here is the github repo: https://github.com/majksner/php-memcached-mamp
已经解决了。发布我对我的问题的答案以供将来参考:)
如何在 MAMP 中安装 memcache php 扩展:
按照本教程操作:
http://www.lullabot.com/articles/setup-memcached-mamp -sandbox-environment
http://marc.info/ ?l=php-general&m=123849727830637&w=2
下载这个正确的memcache.so
http://daleenterprise.com/download/memcache.so
从 Mac OS X 安装 Xcode 工具DVD 或从 Apple Developer Connection 下载以安装 GNU 编译器集合 (gcc)。
首先在 mac os x DVD 中安装 xcode 工具,然后下载并安装第二个工具。
安装程序的文件名:xcode321_10m2003_developerdvd.dmg
Already solved it. Posting my answer to my question for future reference :)
How to install memcache php extension in MAMP:
follow this tutorial:
http://www.lullabot.com/articles/setup-memcached-mamp-sandbox-environment
http://marc.info/?l=php-general&m=123849727830637&w=2
download this correct memcache.so
http://daleenterprise.com/download/memcache.so
Install Xcode Tools from your Mac OS X DVD or download it from Apple Developer Connection to install the GNU Compiler Collection (gcc).
install first the xcode tools in the mac os x dvd then download and install the second one.
filename of installer: xcode321_10m2003_developerdvd.dmg
在最新的 Mac 版 MAMP 中,我必须将以下内容添加到 PHP.ini 中(另请注意,它不是 /conf 目录中的 PHP.ini,它位于 /Applications/MAMP/bin/php/php7.2.7/conf 中.php.ini,查看 phpinfo() 的输出以查看哪个 PHP.ini 处于活动状态)
In the latest MAMP for mac I had to add the following to PHP.ini (note also, it is NOT the PHP.ini in the /conf directory, it is in /Applications/MAMP/bin/php/php7.2.7/conf.php.ini, look at the output of phpinfo() to see which PHP.ini is active)
MAMP 4 确实带有 memcached。事实上,您需要在 php.ini 中启用两个扩展。这很重要,否则 memcached 将无法加载:
memcached.so 依赖于 mghpack.so
MAMP 4 does come with memcached. In fact you will need to enable two extensions in
php.ini
. This is important, otherwise memcached won't load:memcached.so depends on mghpack.so
对于有需要的人来说,请注意:MAMP 4 现在附带 memcached 扩展,但默认情况下未启用。需要编辑正在使用的 PHP 版本的 php.ini 模板并取消注释 memcached.so
Just a quick note for anyone in need: MAMP 4 now ships with memcached extension, but it's not enabled by default. One needs to edit php.ini template for PHP versions being used and uncomment memcached.so