Ryan Lim
Ryan Lim

Reputation: 23

Symfony Bundles : DoctrineCacheBundle - Memcached

I'm testing a DoctrineCacheBundle of Symfony on XAMPP. and IDE is phpstorm.

but I have an issue about PHP Fatal error : Class 'Memcached' not found in ...

Can you give me an advice ?

my configuration is below.

# php.ini

extension=php_memcache.dll


/app/config/config.yml

# Doctrine Configuration

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

# Doctrine 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']]

# Terminal

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

Upvotes: 2

Views: 1364

Answers (1)

Mateusz Sip
Mateusz Sip

Reputation: 1280

Memcache and Memcached are different extensions.

You have a Memcache extenstion, but dependencies use better and maintained Memcached.

Upvotes: 1

Related Questions