I found some very similar questions. However, each of them indicates the use of the wrong php.ini file or memcache is not installed at all or has memcached, and not memcache settings, etc. Therefore, I think this problem is different, despite the fact that searching for this Errors cause some discussion.
Anyway, when I try to instantiate a new Memcache object, I get:
Fatal error: Class 'Memcache' not found in /websites/../app/app_controller.php on line 360
Since debugging files from the command line can sometimes give you bad information, I just added debugging to the pages:
<pre> <?= system('php -i | grep "php.ini"') ?> <?= system('php -i | grep memcache') ?> <?= system('php -i | grep extension_dir') ?> </pre>
This gives me:
Configuration File (php.ini) Path => /etc Loaded Configuration File => /private/etc/php.ini memcache memcache support => enabled memcache.allow_failover => 1 => 1 memcache.chunk_size => 8192 => 8192 memcache.default_port => 11211 => 11211 memcache.default_timeout_ms => 1000 => 1000 memcache.hash_function => crc32 => crc32 memcache.hash_strategy => standard => standard memcache.max_failover_attempts => 20 => 20 Registered save handlers => files user sqlite memcache Registered save handlers => files user sqlite memcache extension_dir => /usr/local/php53/modules => /usr/local/php53/modules
The memcache report tells me that I correctly configured the php.ini file and memcache.so file in the right place, but this information should be clear:
extension_dir = "/usr/local/php53/modules" extension=memcache.so
and memcache.so is:
younker % la /usr/local/php53/modules/memcache.so -rwxr-xr-x 1 younker staff 60196 Feb 14 10:56 /usr/local/php53/modules/memcache.so
So, I obviously missed something, I just don't know why php cannot find the Memcache class.
source share