Search code examples
phpmemcachedosx-mountain-lion

PHP memcached extension not loading or being recognized on OSX


I'm having issues with loading Memcached on my machine(OSX 10.8.2 running MEMPstack(mac nginx mongo php)). I installed libmemcached, I pecl installed memcached, which created the memcached.so:

Listing of contents of extension directory

I then included the memcached.so extension in php.ini:

showing extension inclusion

After a little while of looking, it looked like the extension directory was wrong on phpinfo() so I moved memcached.so to the "correct one" and it's now showing up correctly in phpinfo():

enter image description here enter image description here

I restarted php, restarted, restarted the memcached daemon. and I'm still getting:

Fatal error: Class 'Memcached' not found in /Users/noah/development/egood/api/lib/memcached.php on line 2

Any ideas? I'm loading everything 'correctly' as far as I know, but memcached is still not showing up.


Solution

  • The problem lied in that I needed to create a memcached.ini file, and insert my memcached.so extension there.