I’m trying to integrate Memcached into my Zend Framework website to speed up Ajax calls, but I’m having trouble. I tried initializing it in my bootstrap with this function:
public function _initMemcached(){
$memcache = new Memcached;
$memcache->connect('127.0.0.1', 11211);
Zend_Registry::set('memcached', $memcache);
}
But this simply throws an error that php can’t find the class. According to the datacenter hosting my site, Memcached should be installed in /root/memcached-1.4.13/, so I tried adding a require_once, and now it’s throwing this error:
Warning: require_once() [function.require-once]: open_basedir restriction in effect. File(/root/memcached-1.4.13/Memcached.php) is not within the allowed path(s):
I’ve tried to reset the open_basedir in my bootstrap, but it doesn’t seem to be working. How can I get rid of this error so that I can instantiate a memcached object and get on with my business?
EDIT:
The datacenter tells me that memcached.so is inside /usr/local/lib/php/extensions/no-debug-non-zts-###/ but I can’t access it via SSH to confirm. I have the extension_dir in php.ini set to /usr/local/lib/php/extensions/no-debug-non-zts-###/ and I have extension=memcached.so but I’m still getting Class not found. Do I have my settings incorrect?
memcachedis a php-extension, not a php-script. This means, it must be enabled withinphp.iniwith something likeor something like that. Find out, how the extension is named.
http://php.net/memcached.setup