Install PECL Memcache with LAMPP

On February 21, 2010, in CentOS, Fedora, LAMP, Linux, Open Source, PHP, Tips, Tricks, Web Application, by Sandeep Verma

Hits: 605  

PECL Memcache client of memcached distributed cache server, is a very probable candidate for high-load systems.
Typically you won’t be able to use “pecl” directly and when you try to install manually with phpize you will get an error like:

” PHP Warning: Unknown(): Unable to load dynamic library ‘/opt/lampp/lib/php/extensions/no-debug-non-zts-20020429/memcache.so’ – /opt/lampp/lib/php/extensions/no-debug-non-zts-20020429/memcache.so: undefined symbol: OnUpdateLong in Unknown on line 0″

Below is step-by-step guide of how to install a PECL extension (Memcache in this case) in the latest XAMPP:

make sure you uninstall all and any PHP installations you may have had before along with PECL and PEAR

Download and install XAMPP 1.7.1

Add /opt/lampp/bin to your PATH

Download and install XAMPP Development Package

backup /opt/lampp/include directory to /opt/lampp/include-bak. This directory

Download source distribution of the PHP corresponding to your XAMPP installation

php source distribution is /opt/lampp/include/php

Run “./configure” and “make” on that php source.

Caution: Do NOT run “make install”!!!

Download memcache-2.1.2 anywhere

# cd memcache-2.1.2

# phpize

# ./configure

# make

# make install

Edit /opt/lampp/etc/php.ini and add a line:

extension=”memcache.so”

Knowledge speaks, but wisdom listens. ;)



Looking for something?

Use the form below to search the site:

Still not finding what you're looking for? Drop a comment on a post or contact us so we can take care of it!

Visit our friends!

A few highly recommended friends...