Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

PHP 7, Symfony 3: Fatal error 1 abstract method and must therefore be declared abstract or implement the remaining methods

Tags:

php

php-7

symfony

After a php update from 5.6 to 7, Symfony 3 raise this exception:

Fatal error: Class Symfony\Component\HttpFoundation\Session\Storage\Proxy\SessionHandlerProxy contains 1 abstract method and must therefore be declared abstract or implement the remaining methods (SessionHandlerInterface::write) in \vendor\symfony\symfony\src\Symfony\Component\HttpFoundation\Session\Storage\Proxy\SessionHandlerProxy.php on line 19

is Symfony 3 incompatible with PHP 7? same code work on php 5.6

composer show -i output:

doctrine/annotations                 v1.2.7  Docblock Annotations Parser
doctrine/cache                       v1.6.0  Caching library offering an o...
doctrine/collections                 v1.3.0  Collections Abstraction library
doctrine/common                      v2.6.1  Common Library for Doctrine p...
doctrine/dbal                        v2.5.3  Database Abstraction Layer
doctrine/doctrine-bundle             1.6.1   Symfony DoctrineBundle
doctrine/doctrine-cache-bundle       1.2.2   Symfony Bundle for Doctrine C...
doctrine/inflector                   v1.1.0  Common String Manipulations w...
doctrine/instantiator                1.0.5   A small, lightweight utility ...
doctrine/lexer                       v1.0.1  Base library for a lexer that...
doctrine/orm                         v2.5.3  Object-Relational-Mapper for PHP
incenteev/composer-parameter-handler v2.1.2  Composer script handling your...
jdorn/sql-formatter                  v1.2.17 a PHP SQL highlighting library
kriswallsmith/assetic                v1.3.2  Asset Management for PHP
monolog/monolog                      1.17.2  Sends your logs to files, soc...
paragonie/random_compat              v1.2.2  PHP 5.x polyfill for random_b...
psr/log                              1.0.0   Common interface for logging ...
sensio/distribution-bundle           v5.0.3  Base bundle for Symfony Distr...
sensio/framework-extra-bundle        v3.0.12 This bundle provides a way to...
sensio/generator-bundle              v3.0.3  This bundle generates code fo...
sensiolabs/security-checker          v3.0.2  A security checker for your c...
swiftmailer/swiftmailer              v5.4.1  Swiftmailer, free feature-ric...
symfony/assetic-bundle               v2.7.1  Integrates Assetic into Symfony2
symfony/monolog-bundle               v2.8.2  Symfony MonologBundle
symfony/phpunit-bridge               v2.8.1  Symfony PHPUnit Bridge
symfony/polyfill-intl-icu            v1.1.1  Symfony polyfill for intl's I...
symfony/polyfill-mbstring            v1.1.1  Symfony polyfill for the Mbst...
symfony/polyfill-php56               v1.1.1  Symfony polyfill backporting ...
symfony/polyfill-php70               v1.1.1  Symfony polyfill backporting ...
symfony/polyfill-util                v1.1.1  Symfony utilities for portabi...
symfony/swiftmailer-bundle           v2.3.9  Symfony SwiftmailerBundle
symfony/symfony                      v3.0.3  The Symfony PHP framework
twig/twig                            v1.24.0 Twig, the flexible, fast, and...

php.ini

[opcache]
opcache.enable=1
opcache.memory_consumption=128
opcache.interned_strings_buffer=16
opcache.max_accelerated_files=6000
opcache.use_cwd=1
opcache.validate_timestamps=1
opcache.save_comments=1
opcache.fast_shutdown=1
like image 403
ar099968 Avatar asked Mar 18 '16 15:03

ar099968


1 Answers

Restarting the httpd services can clear this error.

Have not been able to reproduce the error after experiencing it but it could be a PHP crash that in turn causes an incomplete state that makes the error message get stuck in the buffer response of the httpd service, it is then served for every single request to any vhost being served on that service from then on until the service is killed.

Credit Scott Flacks comment in the other answer.

like image 52
Marc Avatar answered Nov 07 '22 01:11

Marc