Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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 :

tar -zxvf memcache-2.2.5.tgz
cd memcache-2.2.5
./configure --enable-memcache
make install

I add to my /usr/local/lib/

Rebooted my apache and run php-m but php seem doesn't load memcache extension I followed this solution from this site

I added full path


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

share|improve this question

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?

share|improve this answer

Are you sure memcached is installed in the correct location? What do you get if you run: locate

Is memcached installed (the binary)? Does it require any extra libraries (libmemcache)?

share|improve this answer
You should use find, not locate, given that it may not yet be in the locate db. – Cian Sep 14 '09 at 11:33
The memcached daemon is installed successfull! and when I locate the memcache extension locate /usr/local/lib/php/extensions/no-debug-non-zts-20060613/ /usr/local/src/memcache-2.2.5/.libs/ /usr/local/src/memcache-2.2.5/modules/ I think the problem is php didn't load the extension ! – billyduc Sep 15 '09 at 2:39

Add an extension_dir directive to tell PHP where to load extensions from and remove the path from the extension directive.

extension =
extension_dir = /usr/local/lib/php/extensions/no-debug-non-zts-20060613
share|improve this answer
poor me ! It doesn't work ! – billyduc Sep 30 '09 at 4:00

One thing that helped me is to use

pecl uninstall memcache
pecl install memcache

Another thing (this applies only to rather old php versions though): says:

In order to use these functions you must compile PHP with Memcache support by using the --enable-memcache[=DIR] option. 
share|improve this answer

this is because of your /var/tmp mounted with noexec permission

you can try to recompile memcache using fuenfundachtzig command after temporarily delete /var/tmp symlink and create new /var/tmp folder. (this setting maybe differ from your server)

#rm /var/tmp
#mkdir /var/tmp

#pecl install memcache

then secure back your temp folder

#rm -rf /var/tmp
#ln -s /tmp /var/tmp

read more about securing tmp here

and how to use PECL with tmp mounted with noexec

share|improve this answer

If you have your PHP compiled, try to remove extension_dir from your php.ini.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.