Compiling the PHP-Memcached 1.5 extension
2005-10-11 11:58

It is a known bug, that the PHP memcache extension doesn't find the zlib libraries even if installed. Check this article if you want to know how to compile it on Debian.

  1. Install the zlib1g and zlib1g-dev packages.
  2. Download the memache 1.5 source from PEAR: pear download memcache.
  3. Extract the source and prepare it for building using phpize.
  4. Configure it using ./configure --with-zlib-dir=/usr/include as outlined in the bug report on PECL.
  5. Instal it using make install and don't forget to restart Apache.

Confirmed working on Debian stable today.

Update (2005-10-25):

There is actually an easier way to achive the same effect: Set the environment variable PHP_ZLIB_DIR to the above directory name. This allows you to use the standard pear package management while still working around the bug. Confirmed working is this variant:

$ export PHP_ZLIB_DIR='/usr/include'
$ pear install memcache