We have moved our forum to GitHub Discussions. For questions about Phalcon v3/v4/v5 you can visit here and for Phalcon v6 here.

Class 'Phalcon\Mvc\Model\Metadata\Memcache' not found

Hey guys, So I'm running locally using wamp: Apache: 2.4 PHP: 7.4 Phalcon: 4

So in my /app/config/services.php I have this few lines:

$di->setShared('modelsMetadata', function(){ return new Phalcon\Mvc\Model\Metadata\Memcache([ 'prefix' => 'geteat' ]); });

and i'm getting:

Fatal error: Uncaught Error: Class 'Phalcon\Mvc\Model\Metadata\Memcache' not found in....

I tried searching for a solution, tried installing memcache extension from https://pecl.php.net/package/memcache

adjusted php.ini, restarted all services from wamp menu, and still no luck. I have no Idea why is this happening, At first I tought may be it's deprecated or something but it's available in the Docs and still can't seem to make it work.

Would appreciate any tips or tricks im missing to load this component.



77.7k
Accepted
answer
edited Aug '20

Phalcon 4 has these types for adapter buit-in: https://github.com/phalcon/cphalcon/tree/master/phalcon/Mvc/Model/MetaData

I'm guessing you'd want to use Libmemcached, for that make sure you install memcached from PECL (not the regular memcache).

Also, make sure you respect cases: it's MetaData, not Metadata



213

Thanks, Haven't noticed the adapter is no longer there