Symfony 2 - Fatal error: Cannot redeclare class SessionHandlerInterface in C:\…\app\cache\dev\classes.php on line 532

后端 未结 7 938
借酒劲吻你
借酒劲吻你 2020-12-11 00:38

After reinstalling my wamp environment this error message is showing on screen after I open app_dev.php:

Fatal error: Cannot redeclare class SessionHa

7条回答
  •  清歌不尽
    2020-12-11 01:12

    PHP version 5.4 introduced a new session management system based on an interface called SessionHandlerInterface and it would seem that your Symfony2 code declares a class with the very same name in the global namespace, so there is a name clash.

    Here are the docs: http://www.php.net/manual/en/class.sessionhandlerinterface.php

    SessionHandlerInterface is an interface which defines a prototype for creating a custom session handler. In order to pass a custom session handler to session_set_save_handler() using its OOP invocation, the class must implement this interface.

提交回复
热议问题