Unable to load memcache.so extension

I built PHP from source with configure command

'./configure' '--prefix=/usr/local/php-5.2.8' '--with-config-file-path=/etc --with-config-file-scan-dir=/etc/php.d' '--with-apxs2=/usr/local/httpd/bin/apxs' '--with-mysql=/usr/local/mysql/' '--with-zlib' 

I installed php memcache extension :

wget http://pecl.php.net/get/memcache
tar -zxvf memcache-2.2.5.tgz
cd memcache-2.2.5
phpize
./configure --enable-memcache
make
make install

I add to my /usr/local/lib/php.in

extension=memcache.so

Rebooted my apache and run php-m but php seem doesn't load memcache extension I followed this solution from this site http://www.howtoforge.com/forums/showthread.php?t=26554

I added full path

extension=/usr/local/lib/php/extensions/no-debug-non-zts-20060613/memcache.so 

rebooted apache But it didn't load memcache extension ! I google around but the same issue ! How can I load this extension _ _"


Firstly run your php binary like

php -v

It should complain that your php.ini wants to load modules that cant be loaded...

If it doesnt complain, run

php --ini

This should give you the location of your php.ini ( just incase your editing the wrong one :D )

Did this help?


The problem is..., at this point: wget http://pecl.php.net/get/memcache Instead of tar -zxvf memcache-2.2.5.tgz, you should do tar -zxvf memcache (this is the filename from wget).

After you extract the file, you will get the latest version of memcache, at the time I do this, I get the folder memcache-3.0.8.

So, the next steps will be:

cd memcache-3.0.8 
phpize 
./configure --enable-memcache 
make
make install

And finally , dont forget to add this line to your php.ini:

extension = memcache.so

And restart Apache.