英文:
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
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论