Drupal 6 and Memcached on MAMP 2.0

Posted on June 3, 2012

Setting up Drupal 6 to use memcached is anything but trivial. There are plenty of instructions out there, but many of these are for MAMP 1.x, or involve MacPorts. This post will show you how to quickly set up memcached locally. Best of all, this guide will leave your system ready to install other PECL extensions quickly.

You will need XCode and MAMP 2.0 installed for any of this to work. Also, it assumes you're using PHP 5.2 through MAMP's settings, but it probably works with 5.3 too. Onward.

Learning Drupal? Subscribe to my Drupal articles, tips and tutorials.

First and foremost, you should set up Homebrew. It's dramatically better than MacPorts. To install it - if you haven't already done so - just run:

1
2
/usr/bin/ruby -e "$(/usr/bin/curl -fsSL \
https://raw.github.com/mxcl/homebrew/master/Library/Contributions/install_homebrew.rb)"

Once that's done, we're ready to install memcached and libevent. Do that with:

1
2
3
4
5
brew install libevent
brew install autoconf
brew install libmemcached
# Don't worry about adding memcached to your LaunchAgents folder.
# We're going to run it manually.

And that's it for the easy part. Kudos to homebrew for making this very straightforward. Now for the interesting part.

To install a PECL extension using MAMP, you need to grab the PHP source. Go ahead and do this now by going to http://us.php.net/distributions/php-5.2.17.tar.bz2, changing 5.2.17 to whatever version of PHP 5.2 your MAMP installation has. To find this out, run find /Applications/MAMP/bin/php -name 'php5.2*' and make note of the last directory.

Once you've got the source, you'll need to extract it in /Applications/MAMP/bin/php/php5.2.17 under a folder structure with the path include/php. Confusing? These lines will do it for you.

1
2
3
4
5
cd /Applications/MAMP/bin/php/php5.2.17
mkdir include
cd include
curl http://museum.php.net/php5/php-5.2.17.tar.bz2 | tar -xz
mv * php

Now we've need to run ./configure on the PHP source, and remove pear.conf from the MAMP distribution - it comes corrupted out of the box, for some reason.

1
2
3
4
 cd php
./configure
cd ../../
rm conf/pear.conf

And finally, we're ready to install the memcached PECL extension and add it to php.ini so it's enabled. Like so:

1
2
3
4
5
cd bin
./pecl install memcached
cd ../
echo -e "\n[memcached]\nextension=memcached.so" >> conf/php.ini
cd ../../

And that's it. This leaves you at the root of MAMP's installation. You should restart MAMP and enjoy fast caching. Don't forget to start memcached by running:

1
memcached -vv

This will start an instance that prints activity to the screen. Very useful when debugging locally, and very easy to restart. This completes the tutorial.

If you ever need to install another PECL extension, your MAMP installation now has all the necessary tools to do so. Just use the PECL binary in /Applications/MAMP/bin/php/php5.2.17/bin and you should be good to go.

Below is the entire set of commands, for posterity.

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
/usr/bin/ruby -e "$(/usr/bin/curl -fsSL \
https://raw.github.com/mxcl/homebrew/master/Library/Contributions/install_homebrew.rb)"

brew install libevent
brew install autoconf
brew install libmemcached
# Don't worry about adding memcached to your LaunchAgents folder.
# We're going to run it manually.

cd /Applications/MAMP/bin/php/php5.2.17
mkdir include
cd include
curl http://museum.php.net/php5/php-5.2.17.tar.bz2 | tar -xz
mv * php
cd php
./configure
cd ../../
rm conf/pear.conf
cd bin
./pecl install memcached
cd ../
echo -e "\n[memcached]\nextension=memcached.so" >> conf/php.ini
cd ../../

Comments

john erhardtFeb. 26, 2013, 7:34 p.m.

homebrew repo is in slightly different location (here's the command listed on the homebrew page): ruby -e "$(curl -fsSL https://raw.github.com/mxcl/homebrew/go)"

Otherwise, this worked perfect. Thanks!

Reply
RitouglaApril 3, 2019, 9:44 a.m.

Interesting data is here on bob honey who just do stuff for only you.

Reply
davidFeb. 22, 2019, 10:39 a.m.

Really appreciate this wonderful post that you have provided for us.Great site and a great topic as well i really get amazed to read this. Its really good Ryan Gosling 2049 Jacket site able to provide you with the writing help you have been looking for also get result in any time.

Reply
HardylinApril 20, 2019, 10:17 a.m.

Drupal 6 and Memcached on MAMP are good for the people. As a reader i just like the creation of this blog and cheap assignment writing service blogs. This is a special blog with some basic ideas.

Reply
dsdsdMay 6, 2019, 5:41 a.m.

Par conséquent, la manière d'éliminer efficacement les préoccupations des clients en matière de vente est une connaissance et une compétence qui doivent être maîtrisées par le vendeur. bell ross montres Parce que les vendeurs intelligents savent que si vous ne pouvez pas éliminer fondamentalement les préoccupations de vos clients, la transaction sera difficile à obtenir. chopard montres La raison pour laquelle les clients sont vigilants et inquiets au sujet des vendeurs peut être qu’ils ont été victimes de tromperies lors de leurs expériences précédentes ou qu’ils ont acheté des produits pour se décevoir eux-mêmes.

Reply
jennyMay 10, 2019, 12:10 a.m.

Drupal is really good for building school websites like Do My Essay | 24HWritemyessays.com . There are many best reasons that Drupal CMS are good and effective in building school websites

Reply
ailsaJune 1, 2019, 3:36 a.m.

The number of versace watch replica in various styles. The watch is a classic style with an antique style and a stylish watch. The replica Versace watch is constantly highlighting the craftsmanship and quality.

Selling top-quality replica Versace character watches, these replica watches for sale come from manufacturers and must comply with our strict qc standards. Many watches have a specific depth of water resistance, so you don't have to bother to catch it when it rains without an umbrella.

Reply
Experienced dissertation editorsJuly 16, 2019, 9:01 a.m.

Hey, Your blog is very informative. It is nice to read such high-quality content. Attractive information on your blog, thank you for taking the time and share with us. Myassignmenthelp delivers high-quality content related to experienced dissertation editors.

Reply
Sumitsingh72July 17, 2019, 5:38 a.m.

This post is very informative on this topic Thank you for sharing this post with us. packers and movers Pune packers and movers charges packers and movers charges Pune

Reply
luxuryJuly 25, 2019, 7:55 a.m.

replica richard mille sports designer and manufacturer APRP), Mille made his first major strategic decision - his company would produce modern and classy timepieces. The plan was apparently to allow Richard Mille to make the timepiece in the same way that a racing car makes a racing car - completely ignoring the cost of production and focusing on using modern production techniques and materials for optimal performance. Sure, cars and watches "perform" a little differently, but the concept was enough to propel Richard Mille to where he is today - a company that has more or less kept up with its product development philosophy. If anything, what Richard miller was able to add to the original formula was the importance of welling up elite customers-something that luxury (in all its forms) products have needed for centuries.richard mille watch price

Reply
Jason RoyJuly 26, 2019, 12:41 p.m.

After getting complete information regarding top quality packaging firm which enhance my knowledge regarding Custom Boxes Wholesale by quickboxespackaging.com is the best webiste or firm to do business for getting custom product boxes. I thank you so much for sharing these interesting details. Good luck!

Reply
Nikki HopeAug. 7, 2019, 8:03 p.m.

Great tips and very easy to understand. This will definitely be very useful for me when I get a chance to start my blog. Custom Printed Boxes

Reply
BarbaraEvanceSept. 2, 2019, 12:08 p.m.

A narrative essay is a piece of writing that recreates an experience through time. That is why it is quite difficult to write a narrative essay. You need to be able to clearly articulate your thoughts and at the same time have the talent of a storyteller to beautifully express thoughts your own thoughts on paper. On my site, you will find all the necessary information on how to write a narrative essay .

Reply
King ireneAug. 8, 2019, 10:54 a.m.

CBD has been a subject of conversation among lots of people worldwide over the last few years. While some countries have not yet legislated using CBD for medical residential or commercial properties, there are countries that have currently legislated it. CBD has much health and wellness advantages to the human body and this is the reason for the enhanced usage and utilization of the product. Lots of people puzzle in between CBD and marijuana. It is very important to note that CBD is a substance that is gotten from the hemp plant in the form of cannabidiols, while cannabis is gotten from the cannabis plant. Cannabis is different from hemp plant because of the material of THC substances. These are the ones in charge of psychoactivity as well as the high feeling individuals experience when they take in cannabis. The marijuana plant has very high components of the THC while the hemp plant only has a couple of traces of THC.

Concerning CBD vape juice

CBD vape juice is simply one of the kinds that CBD can be provided in the body. It is favored by lots of people due to the fact that it is convenient for individuals that have health and wellness issues and also those that do not. CBD vape juice is primarily any vape juice that does not have nicotine in it. CBD is a compound that is gotten from the hemp plant and it naturally occurs as cannabidiol. It is mostly made use of to reduce pain as well as inflammations brought on by a vast array of problems and also conditions. The juice is made when tinctures that can not be taken in by mouth are combined with coconut oil to make it edible.

Exactly how secure it is to vape CBD juice?

Most people think that vaping CBD juice might result in the development of cancers and negative effects on the reproduction system. CBD Vape Juice The opportunities and risk of this taking place are very minimal today. This is due to the fact that vape juice is not made using pure nicotine anymore. A few years back, CBD vape juice was made with pure nicotine as one of the vital active ingredients. However, due to the adverse effects of the pure nicotine to the body, the procedure quit as well as today, vape mod CBD juice is primarily pure with very few traces of THC. Rather than creating cancer cells, CBD vape juice is used by cancer people to offer alleviation to nausea as well as pins and needles.

Reply
kevinAug. 9, 2019, 6:02 p.m.

Once I posted an article about different festivals. And I received amazing response on it on https://altomerge.com/reviews. People really liked my article, they posted positive reviews.

Reply
dfbAug. 16, 2019, 9:49 a.m.

产后生完孩子怎么丰胸好?生完孩子也能照样丰挺!丰胸食物初为人母,看着孩子的每一个动作,每一次哭笑。做妈妈的应该都是十分开心的。但是烦恼也会随之而来产后快速丰胸方法。产后胸部的缩水现象让本来丰满的胸部变得干瘪起来。而胸部是女性形象的一个十分重要的象征如何应对怀孕胸部下垂,其丰挺程度直接影响着女人额魅力指数。更多的宝妈都投入到了生完孩子丰胸的历程中来粉嫩公主酒酿蛋。那么生完孩子怎么丰胸好怎么丰胸最有效呢。今天小编就网罗了网上的诸多方法供大家参考。

Reply
jakdownSept. 3, 2019, 1:18 p.m.

If you haven't checked out my new blog, do visit https://skinandbeautycares.com. I post blogs there on daily basis, and they are good. The overall response I receive on my work is amazing. SkinAndBeautyCares.com

Reply
FrankSept. 9, 2019, 9:59 a.m.

It is very important for each student to correctly write an essay. And it’s not always possible to deal with this yourself. Our professional writers with many years of experience in writing essays will help you in writing essays on any topic. https://www.professays.com

Reply
FrankSept. 9, 2019, 10 a.m.

franksmee31@gmail.comIt is very important for each student to correctly write an essay. And it’s not always possible to deal with this yourself. Our professional writers with many years of experience in writing essays will help you in writing essays on any topic. https://www.professays.com

Reply
liamSept. 10, 2019, 3:03 p.m.

Loving the articles, as per usual. Business is one of the most intriguing parts of daily life I remember reading something that stated first impressions are imperative to how businesses stand in the long run, and what better way to get a first impression than through a name? This is why this site should be something to look at if you want to wow your clients with your name.

Reply
jakdownSept. 15, 2019, 11:26 a.m.

Photo Editing HQ is the name of a pioneer Online Photo editing service provider company. Established with an aim to provide ultimate professional Clipping Path Service, Image Masking Service, Image Editing , Image Masking Service , Image Retouching Service & so on with lowest possible price & within shortest possible turnaround. We have vast experience in editing event photos, product photos, real estate photos and so on. We provide ecommerce photo editing, Deep Etching, Cut Out Image and cheap retouching service for photographer. jewellry retouching service

Reply
Haider aliSept. 19, 2019, 2:08 p.m.

Thanks for a very interesting blog. What else may I get that kind of info written in such a perfect approach? I’ve a undertaking that I am simply now operating on, and I have been at the look out for such info. ACADEMIC WRITING SERVICE FOCUSED ON LAW AND FINANCE

Reply
voyance par telephoneSept. 24, 2019, 10:35 a.m.

To say the truth I am very impressed by what you told. You share tons of interesting info, neat and excellent design you’ve got here. It’s certainly one of the most informative stuff on this topic I’ve ever read.

Reply
rockabilly styleOct. 3, 2019, 10:45 a.m.

Excellent article. Very interesting to read. I really love to read such a nice article. Thanks! keep rocking. rockabilly style

Reply
sydney splashbacksOct. 5, 2019, 9:12 a.m.

I like your post. It is good to see you verbalize from the heart and clarity on this important subject can be easily observed... sydney splashbacks

Reply
hyderOct. 5, 2019, 2:01 p.m.

When you use a genuine service, you will be able to provide instructions, share materials and choose the formatting style. digital cartoon

Reply
hyderOct. 5, 2019, 7:47 p.m.

I definitely enjoying every little bit of it. It is a great website and nice share. I want to thank you. Good job! You guys do a great blog, and have some great contents. Keep up the good work. blog header in just one hour

Reply
IDN PokerOct. 11, 2019, 4:04 p.m.

Kronospoker Situs Judi Online, IDN Poker, IDN Poker Mobile, Agen Poker Terpercaya Indonesia untuk permainan Poker Online, Domino Qiu Qiu, Ceme Keliling, Capsa Susun dan Super10

Reply
<a href="https://www.rockabilly-shirts.com/">rockabilly shirt</a>Oct. 12, 2019, 10:40 a.m.

We are really grateful for your blog post. You will find a lot of approaches after visiting your post. I was exactly searching for. Thanks for such post rockabilly shirt and please keep it up. Great work.

Reply
<a href="https://www.charliesheenshirts.com/">Charlie Sheen shirts</a>Oct. 12, 2019, 2:25 p.m.

This particular is usually apparently essential and moreover outstanding truth along with for sure fair-minded and moreover admittedly useful My business is looking to find in advance designed for this specific useful stuffs… Charlie Sheen shirts

Reply
vector logoOct. 12, 2019, 7:50 p.m.

You make so many great points here that I read your article a couple of times. Your views are in accordance with my own for the most part. This is great content for your readers. vector logo

Reply
Haider aliOct. 13, 2019, 2:49 p.m.

Pretty good post. I just stumbled upon your blog and wanted to say that I have really enjoyed reading your blog posts. Any way I'll be subscribing to your feed and I hope you post again soon. Big thanks for the useful info. Calgary Commercial Property Management

Reply
<a href="http://weedhuis.com/product/silver-state-relief/">buy weed online</a>Oct. 15, 2019, 10:46 a.m.

We are really grateful for your blog post. You will find a lot of approaches after visiting your post. I was exactly searching for. Thanks for such post and please keep it up. Great work. buy weed online

Reply
Haider aliOct. 15, 2019, 2:41 p.m.

A very awesome blog post. We are really grateful for your blog post. You will find a lot of approaches after visiting your post. write your creative content

Reply
Haider aliOct. 16, 2019, 7:51 a.m.

Yes i am totally agreed with this article and i just want say that this article is very nice and very informative article.I will make sure to be reading your blog more. You made a good point but I can't help but wonder, what about the other side? !!!!!!Thanks PHP PUBG Generator

Reply
hyderOct. 17, 2019, 8:02 a.m.

Awesome article, it was exceptionally helpful! I simply began in this and I'm becoming more acquainted with it better! Cheers, keep doing awesome! golden ratio logo

Reply
petter sonOct. 19, 2019, 11:56 a.m.

I am a new visitor here and I found it very interesting, I am, so impressed to read this coding but you did not explain it what is meant your sharing and why I can use it for the betterment of phd dissertation writing service

Reply
avast premier crackOct. 20, 2019, 11:23 a.m.

Here at this site really the fastidious material collection so that everybody can enjoy a lot. avast premier crack

Reply

Post New Comment