我又遇到了 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
网站工作正常,但是当我发送表单时,我总是收到此错误:
[2016-06-29 09:17:12] request.CRITICAL:未捕获的 PHP 异常 Symfony\Component\Debug\Exception\UndefinedFunctionException:“尝试从命名空间“Doctrine\Common\Cache”调用函数“apc_fetch”。” 在 ROUTE_TO_PROJECT/vendor/doctrine/cache/lib/Doctrine/Common/Cache/ApcCache.php 第 41 行 {"exception":"[object] (Symfony\Component\Debug\Exception\UndefinedFunctionException(code: 0): 试图调用函数 \"apc_fetch\" 来自命名空间 \"Doctrine\Common\Cache\"。在 ROUTE_TO_PROJECT/vendor/doctrine/cache/lib/Doctrine/Common/Cache/ApcCache.php:41)"} []
这是我的作曲家:
"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": "~2.0@dev"
为什么 Symfony 调用 apc_fetch 而不是 apcu_fatch?