Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to enable the memcached PHP extension after installing with homebrew?

I recently installed memcached with homebrew, I'm not entirely sure how to enable it on my PHP envirionment since I added extension=memcached.so in /etc/php.ini in Lion OS X.

Even I restarted apache too, nothing is still loaded.

If I call get_loaded_extensions(), I do not see memcached in the list, how can I enable it when installed from homebrew?

EDIT:

What I did in Terminal was:

$ brew install memcached

It installed just fine, now I went to /etc/php.ini and appended:

extension=memcached.so

like image 782
MacMac Avatar asked Oct 22 '11 14:10

MacMac


1 Answers

Install Memcached:

# lists all memcached related packages brew search memcached  # install memcached as well as memcached extension for PHP brew install memcached brew install php54-memcached  # start memcached daemon with 24MB on port 11211 (default) memcached -d -m 24 -p 11211 

Add to your php.ini file to add:

extension=memcached.so 

Restart php or php5-fpm and your server. Verify:

php -i | grep memcached # should show memcached version, etc. 
like image 105
aleemb Avatar answered Oct 25 '22 20:10

aleemb