Symfony2 and HHVM Declaration of Doctrine\DBAL\Driver\PDOConnection::prepare() must be compatible

心不动则不痛 提交于 2019-12-07 17:07:45

问题


i am trying to set up a symfony2 project on a HHVM machine,

The HHVM is running on FastCGI as explained in the hhvm tutorial, thus running behind an apache2 server on Debian.

I have created everything but when i try to run my application i am getting the following error:

ContextErrorException: 16777217: Declaration of Doctrine\DBAL\Driver\PDOConnection::prepare() must be compatible with that of Doctrine\DBAL\Driver\Connection::prepare() in /LOCATION/shared/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOConnection.php line 30

I am thinking this has something to do with PDO in HHVM but i tested it using the class_exists('PDO') and that says that PDO is enabled


回答1:


This is an issue that was fixed via a pull request to the master branch of doctrine/dbal about 2 months ago. However, depending on the branch of Symfony 2 you are using, that doctrine/dbal fix may not be included.

https://github.com/doctrine/dbal/pull/373

If it is possible to use a version of Symfony 2 that includes this latest doctrine/dbal fix, I think you will see that issue go away.




回答2:


I've had the same issue and upgrading doctrine/orm and doctrine/dbal to latest versions (listed below) fixed my problems.

doctrine/orm : 2.5.@dev doctrine/dbal: 2.5.@dev

To safely upgrade, open your composer.json file, find and change the versions like so:

composer.json

"require": {
    // ... other package requirements
    "doctrine/orm": "~2.5.*@dev",
    "doctrine/dbal: "~2.5.*@dev", 
    // .. more packages

Then run composer update doctrine/* which will remove the old versions of doctrine and update all doctrine packages.



来源:https://stackoverflow.com/questions/21890930/symfony2-and-hhvm-declaration-of-doctrine-dbal-driver-pdoconnectionprepare-m

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!