0

I am trying to run php with memcache support but I am constantly receiving this error message in the config.php file.

<b>Fatal error</b>:  Class 'Memcache' not found in <b>

Below is the relevant config.php snippet

require 'lib/Minify/Cache/Memcache.php';
$memcache = new Memcache;
if(@$memcache->connect('127.0.0.1', 11211)) {
    $min_cachePath = new Minify_Cache_Memcache($memcache);
}

The second line in above snippet is causing the issue. I have installed php56 using brew. I have installed php56-memcache using brew I have also installed php56-memcached using brew

when I run php -i | grep memcache I can see both memcache and memcached enabled.

here is the output php -i | grep memcache

Please help me out. As mentioned in comments this is not a duplicate to PHP memcached Fatal error: Class 'Memcache' not found' as I have both modules installed and still I am not able to use.

xor
  • 2,668
  • 2
  • 28
  • 42
  • @thamilan and also to_rest_all_who_marked_duplicate, do you guys even had a look at my question? I clearly said I have both modules loaded, Go take a look at the accepted answer of the same question that you guys have tagged here, the 5th comment clearly states loading both modules shouldn't be a problem. My Problem is different, so if you guys can't help, just leave the question untouched – xor Nov 02 '17 at 05:32
  • 1
    solved it, thanks for help – xor Nov 10 '17 at 09:29
  • hello @noobmaster69, how did you solve it? I have the same problem now) – Gag Baghdasaryan Mar 05 '20 at 08:19
  • Hey @GagBaghdasaryan, I do not remember very clearly, but I guess it was because I had two separate php installed (one mac's default and other I installed later). Make sure that the memcache and memcached that your are using is for the same version of php on which your website runs. – xor Apr 24 '20 at 07:10
  • Hey @noobmaster69. Thanks, actually I already fixed the problem on my end. But I don't remember how :D – Gag Baghdasaryan Apr 29 '20 at 07:55

0 Answers0