English 中文(简体)
MAMP: How to install 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 :)

最佳回答

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

问题回答

Pecl Memcached library for MAMP which is always up to date.

Here is the github repo: https://github.com/majksner/php-memcached-mamp

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)

extension=igbinary.so
extension=memcached.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:

extension=msgpack.so
extension=memcached.so

memcached.so depends on mghpack.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





相关问题
Memcached Writes Extremely Slow

I m running memcached on ec2 instances and in some cases am seeing extremely slow writes (10s) for small amounts of data. I m using memcache-client from rails on the client side. Has anyone seen ...

can t install memcache php module

i m trying to install memcache module from http://pecl.php.net/package/memcache. Im using xampp in ubuntu (lampp) with php 5.3. After download the extension, I run phpize, make and make install, then ...

sphinx is returning stale results

Environment: Memcached, Rails 2.2.2 + cache_money, Sphinx + thinking sphinx The following yields stale results: - add a record; mysql contains the correct data - the record is probably cached in ...

Pylons and Memcached

Anyone happen to use this combination in their web application? I m having a bit of trouble finding some sort of tutorial or guideline for configuring this. Also seeing as how I started using Pylons ...

Memcached crashing under moderate load

When running memcached, after a few minutes of use it starts throwing the following errors and memcache stops responding. mcm_server_connect_next_avail():2328 I have searched the Google, and it ...

enyim and memcached : NOT_STORED errors

We are using memcached 1.2.4 via enyim and are finding it difficult to get some objects to cache. If I watch the memcache console it just says NOT_STORED . I think we need to use [serializable] but ...

PHP - Memcache - HTML Caching

I would like to create a caching system that will bypass some mechanisms in order to improve the performance. I have some examples: 1-) I have a dynamic PHP page that is updated every hour. The page ...

热门标签