Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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 _ _"

share|improve this question
add comment

5 Answers

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
add comment

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

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 memcache.so /usr/local/lib/php/extensions/no-debug-non-zts-20060613/memcache.so /usr/local/src/memcache-2.2.5/.libs/memcache.so /usr/local/src/memcache-2.2.5/modules/memcache.so I think the problem is php didn't load the extension ! –  billyduc Sep 15 '09 at 2:39
add comment

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

extension = memcache.so
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
add comment

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): http://www.hollub.at/phpmanual/ref.memcache.html 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
add comment

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
add comment

Your Answer

 
discard

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.