如何在Symfony 6中使用PHP 8.2安装Neo4j bundle?

huangapple go评论59阅读模式
英文:

How install neo4j bundle in symfony 6 with php 8.2

问题

我刚刚安装了一个新的Symfony项目,并尝试通过以下方式安装Neo4j捆绑包:composer require neo4j/neo4j-bundle。
这是我收到的错误信息:

无法使用neo4j/neo4j-bundle的最新版本0.4.2,因为它需要php ^7.0,而您的平台不满足该要求。

在PackageDiscoveryTrait.php的第317行:
neo4j/neo4j-bundle包具有与您的PHP版本、PHP扩展和Composer版本不兼容的要求:

  • neo4j/neo4j-bundle 0.4.2需要php ^7.0,而您安装的版本是8.2.0。
英文:

I just installed a new symfony project and tried to install the neo4j bundle by doing: composer require neo4j/neo4j-bundle.
Here is the error I got:

Cannot use neo4j/neo4j-bundle's latest version 0.4.2 as it requires php ^7.0 which is not satisfied by your platform.

In PackageDiscoveryTrait.php line 317:
   Package neo4j/neo4j-bundle has requirements incompatible with your PHP version, PHP extensions and Composer version:
     - neo4j/neo4j-bundle 0.4.2 requires php ^7.0 which does not match your installed version 8.2.0.

答案1

得分: 0

根据GitHub,版本0.4.2相当多年前的版本:https://github.com/neo4j-php/neo4j-symfony/tree/0.4.2
所以我猜你必须安装dev-master版本的bundle。

另外,直接安装laudis/neo4j-php-client也是可能的,不过你需要手动实例化连接。我是这样做的(并将一些内容抽象到它们自己的库中),你可以在这里查看我的代码:https://github.com/neo4j-php/cypher-entity-manager 和 https://github.com/ember-nexus/api

英文:

According to GitHub the version 0.4.2 is quite a few years old: https://github.com/neo4j-php/neo4j-symfony/tree/0.4.2
So I guess you must install the bundle in the version dev-master.

Otherwise directly installing laudis/neo4j-php-client is also possible, though you need to instantiate the connection manually. I've done it this way (and abstracted a few things into their own libs), you can look at my code here: https://github.com/neo4j-php/cypher-entity-manager and https://github.com/ember-nexus/api

huangapple
  • 本文由 发表于 2023年7月10日 22:53:28
  • 转载请务必保留本文链接:https://go.coder-hub.com/76654958.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定