How to compile and install the php 4 memcached extension

Here’s a short guide on installing the php 4 memcached extension from source. I write it as a reference as I couldn’t find some precise instructions on this.

Download and extract the source code:

system:~# wget http://pecl.php.net/get/memcache-2.1.2.tgz
system:~# tar xvfz memcache-2.1.2.tgz

Prepare the extension for compiling:

system:~# cd memcache-2.1.2
system:~/memcache-2.1.2# phpize

Configure, make and make install:

system:~/memcache-2.1.2# ./configure
system:~/memcache-2.1.2# make
system:~/memcache-2.1.2# make install

If configure fails with the following error: configure: error: Cannot find php_session.h (as it did on ubuntu and debian for me) then you’ll have to create a symbolic link to /usr/include/php4 called /usr/include/php. If you don’t have one of those directories, then you’re probably missing the php4-dev package.

Comments

Post new comment

  • Allowed HTML tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd>
  • Lines and paragraphs break automatically.
  • Adds typographic refinements.
  • Web page addresses and e-mail addresses turn into links automatically.
  • You can enable syntax highlighting of source code with the following tags: <code>, <blockcode>. The supported tag styles are: <foo>, [foo].

More information about formatting options

CAPTCHA
This question is for testing whether you are a human visitor and to prevent automated spam submissions.