/ / Symfony 3 / APCu + PHP7 - PHP, symfony, apc, php-7, apcu

Symfony 3 / APCu + PHP7 - php, symfony, apc, php-7, apcu

Ich habe wieder ein Problem mit APCu und PHP7. Hier ist mein Conf.

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

Die Website funktioniert einwandfrei, aber wenn ich ein Formular sende, bekomme ich immer diesen Fehler:

[2016-06-29 09:17:12] Anfrage.KRITISCH: Uncaught PHP Exception SymfonyComponentDebugExceptionUndefinedFunctionException: "Versuch, die Funktion" apc_fetch "aus dem Namespace aufzurufen "DoctrineCommonCache". "Bei ROUTE_TO_PROJECT / Hersteller / Doktrin / Cache / Lib / Doctrine / Common / Cache / ApcCache.php Zeile 41 {"Ausnahme": "[Objekt] (SymfonyComponentDebugExceptionUndefinedFunctionException (Code: 0): Versuch, die Funktion "apc_fetch" aus dem Namespace aufzurufen "DoctrineCommonCache". beim ROUTE_TO_PROJECT / Hersteller / Doktrin / Cache / Lib / Doctrine / Common / Cache / ApcCache.php: 41) "} []

Hier ist mein Komponist:

"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"

Warum ruft Symfony apc_fetch statt apcu_fatch?

Antworten:

5 für die Antwort № 1

In früheren Versionen von APCu, das APC Modul und Funktionen wurden als Teil der Bibliothek zur Verfügung gestellt.

In den neuesten (PHP 7) Versionen von APCu, rückwärtskompatibel APC ist ein separate Erweiterung.


4 für die Antwort № 2

Das ist meine Lösung:

services.yml

serializer.mapping.cache.apcu:
class: DoctrineCommonCacheApcuCache

confing_prod.yml

serializer:
cache: serializer.mapping.cache.apcu

Idk, wenn diese Lösung in Ordnung ist, aber sieht aus wie es funktioniert. Also, wenn Sie eine bessere Lösung kennen, würde ich es gerne verwenden.


2 für die Antwort № 3

Sie können apcu mit der Symfony-Validierung arbeiten, indem Sie den Doculate-Cache-Wrapper verwenden

config.yml

validation:
cache: validator.mapping.cache

services.yml

doctrine.apcu.cache:
class: DoctrineCommonCacheApcuCache

validator.mapping.cache:
class: SymfonyComponentValidatorMappingCacheDoctrineCache
arguments: ["@doctrine.apcu.cache"]