我正在XAMPP上测试一个Sytrfony的DoctrineCacheBundle。 IDE是phpstorm。
但我有一个关于PHP致命错误的问题:在'...中找不到类'Memcached'
你能给我一个建议吗?
我的配置如下。
#php.ini
extension=php_memcache.dll
/app/config/config.yml
#Practtrine配置
doctrine: orm: auto_generate_proxy_classes: "%kernel.debug%" naming_strategy: doctrine.orm.naming_strategy.underscore auto_mapping: true metadata_cache_driver: type: service id: doctrine.cache.memcached query_cache_driver: type: service id: doctrine.cache.memcached result_cache_driver: type: service id: doctrine.cache.memcached
#Proftrine Cache
doctrine_cache: providers: service_connection_memcached_provider: memcached: connection_id: "memcached_connection_service"
/app/config/services.yml
services: memcached_connection_service: class: "Memcached" calls: - [ addServers, [ "%memcached_servers%" ]] doctrine.cache.memcached: class: Doctrine\Common\Cache\MemcachedCache calls: - [ setMemcached, ['@memcached_connection_service']]
#Perminal
PHP Fatal error: Class 'Memcached' not found in C:\xampp\htdocs\test\var\cache\dev\appDevDebugProjectContainer.php on line 2739 Fatal error: Class 'Memcached' not found in C:\xampp\htdocs\test\var\cache\dev\appDevDebugProjectContainer.php on line 2739 PHP Fatal error: Class 'Memcached' not found in C:\xampp\htdocs\test\vendor\doctrine\doctrine-cache-bundle\Tests\Functional\Fixtures\Memcached.php on line 8 Fatal error: Class 'Memcached' not found in C:\xampp\htdocs\test\vendor\doctrine\doctrine-cache-bundle\Tests\Functional\Fixtures\Memcached.php on line 8
答案 0 :(得分:1)
Memcache和Memcached是不同的扩展。
您有一个Memcache扩展,但依赖关系使用更好并维护Memcached。