2016-06-29 8 views
3

APCu 및 PHP7에 다시 문제가 있습니다. 여기에 내 conf가 있습니다.Symfony 3/APCu + PHP7

framework: 
    validation: 
     cache: validator.mapping.cache.doctrine.apc 
    serializer: 
     cache: serializer.mapping.cache.apc 

doctrine: 
    orm: 
     metadata_cache_driver: apcu 
     result_cache_driver: apcu 
     query_cache_driver: apcu 

웹 사이트 확인을 작동하지만 내가 양식을 보낼 때, 나는 항상이 오류가 발생합니다 :

"require": { 
    "php": ">=5.5.9", 
    "symfony/symfony": "3.0.*", 
    "doctrine/orm": "^2.5", 
    "doctrine/doctrine-bundle": "^1.6", 
    "doctrine/doctrine-cache-bundle": "^1.2", 
    "symfony/swiftmailer-bundle": "^2.3", 
    "symfony/monolog-bundle": "^2.8", 
    "sensio/distribution-bundle": "^5.0", 
    "sensio/framework-extra-bundle": "^3.0.2", 
    "incenteev/composer-parameter-handler": "^2.0", 
    "knplabs/knp-paginator-bundle": "^2.5", 
    "liip/imagine-bundle": "^1.5", 
    "jms/serializer-bundle": "^1.1", 
    "symfony/assetic-bundle": "^2.8", 
    "gopay/payments-sdk-php": "^1.1", 
    "knplabs/knp-snappy-bundle": "~1.4", 
    "friendsofsymfony/user-bundle": "[email protected]" 

왜 심포니 통화 apc_fetch 대신 apcu_fatch입니다 : 여기

[2016-06-29 09:17:12] request.CRITICAL: Uncaught PHP Exception Symfony\Component\Debug\Exception\UndefinedFunctionException: "Attempted to call function "apc_fetch" from namespace "Doctrine\Common\Cache"." at ROUTE_TO_PROJECT/vendor/doctrine/cache/lib/Doctrine/Common/Cache/ApcCache.php line 41 {"exception":"[object] (Symfony\Component\Debug\Exception\UndefinedFunctionException(code: 0): Attempted to call function \"apc_fetch\" from namespace \"Doctrine\Common\Cache\". at ROUTE_TO_PROJECT/vendor/doctrine/cache/lib/Doctrine/Common/Cache/ApcCache.php:41)"} []

내 작곡가입니다 ?

답변

4

이 내 솔루션입니다 :

services.yml

serializer.mapping.cache.apcu: 
    class: Doctrine\Common\Cache\ApcuCache 

confing_prod.yml

serializer: 
    cache: serializer.mapping.cache.apcu 

IDK이 솔루션이 확인되어 있지만 그것이 작동하는 것 같습니다. 그래서 당신이 더 나은 해결책을 안다면, 나는 그것을 사용하고 싶습니다.

4

APCu의 이전 버전에서는 APC 모듈 및 기능이 라이브러리의 일부로 제공되었습니다.

APCu의 최신 (PHP 7) 버전에서 이전 버전과 호환되는 APCseparate extension입니다.

1

당신은 교리 캐시 래퍼

config.yml

validation: 
    cache: validator.mapping.cache 

services.yml

doctrine.apcu.cache: 
     class: Doctrine\Common\Cache\ApcuCache 

validator.mapping.cache: 
     class: Symfony\Component\Validator\Mapping\Cache\DoctrineCache 
     arguments: ['@doctrine.apcu.cache'] 
를 사용 심포니 검증 작업 apcu 얻을 수 있습니다
관련 문제