我又遇到了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: Uncaught异常request.CRITICAL“试图从名称空间调用函数”“Doctrine\Common”。在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?
发布于 2016-07-02 07:22:07
在APCu的早期版本中,APC模块和函数是作为库的一部分提供的。
在最近(PHP7)版本的APCu中,向后兼容的APC是一个单独延伸。
发布于 2016-06-29 08:18:00
这是我的解决办法:
services.yml
serializer.mapping.cache.apcu:
class: Doctrine\Common\Cache\ApcuCacheconfing_prod.yml
serializer:
cache: serializer.mapping.cache.apcu如果这个解决方案还好的话,可以使用它,但是它看起来很有效。所以如果你知道更好的解决方案,我想用它。
发布于 2016-12-08 11:44:18
您可以使用理论缓存包装器让apcu使用symfony验证。
config.yml
validation:
cache: validator.mapping.cacheservices.yml
doctrine.apcu.cache:
class: Doctrine\Common\Cache\ApcuCache
validator.mapping.cache:
class: Symfony\Component\Validator\Mapping\Cache\DoctrineCache
arguments: ['@doctrine.apcu.cache']https://stackoverflow.com/questions/38093196
复制相似问题