Installing Symfony project with PHP 7.3 version

参考地址:https://cmsdk.com/php/installing-symfony-project-with-php-7-3-version.html

 

Tryng to install (and after updating composer):

composer create-project symfony-cmf/sandbox cmf-sandbox

I have those errors:

Installing symfony-cmf/sandbox (2.0.0)
  - Installing symfony-cmf/sandbox (2.0.0): Loading from cache
Created project in cmf-sandbox
Loading composer repositories with package information
Installing dependencies (including require-dev) from lock file
Your requirements could not be resolved to an installable set of packages.
  Problem 1
    - Installation request for phpcr/phpcr-utils 1.3.0 -> satisfiable by phpcr/phpcr-utils[1.3.0].
    - phpcr/phpcr-utils 1.3.0 requires php ^5.6|7.0.x|7.1.x -> your PHP version (7.3.0) does not satisfy that requirement.
  Problem 2
    - phpcr/phpcr-utils 1.3.0 requires php ^5.6|7.0.x|7.1.x -> your PHP version (7.3.0) does not satisfy that requirement.
    - doctrine/phpcr-odm 1.4.2 requires phpcr/phpcr-utils ^1.2.8 -> satisfiable by phpcr/phpcr-utils[1.3.0].
    - Installation request for doctrine/phpcr-odm 1.4.2 -> satisfiable by doctrine/phpcr-odm[1.4.2].

Edit: Continuing the recommendation of Timo, I was able to install the project by executing the following:

composer create-project --ignore-platform-reqs symfony-cmf/sandbox cmf-sandbox

but I have obtained the following errors:

PHP Fatal error:  Uncaught Symfony\Component\Debug\Exception\ContextErrorException: Warning: count(): Parameter must be an array or an object that implements Countable in /srv/http/symfony/cmf-sandbox/vendor/symfony-cmf/routing/src/ChainRouter.php:101
Stack trace:
#0 /srv/http/symfony/cmf-sandbox/vendor/symfony-cmf/routing/src/ChainRouter.php(308): Symfony\Cmf\Component\Routing\ChainRouter->all()
#1 /srv/http/symfony/cmf-sandbox/var/cache/dev/appDevDebugProjectContainer.php(1670): Symfony\Cmf\Component\Routing\ChainRouter->setContext(Object(Symfony\Component\Routing\RequestContext))
#2 /srv/http/symfony/cmf-sandbox/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Container.php(335): appDevDebugProjectContainer->getCmfRouting_RouterService()
#3 /srv/http/symfony/cmf-sandbox/var/cache/dev/appDevDebugProjectContainer.php(4955): Symfony\Component\DependencyInjection\Container->get('cmf_routing.rou...')
#4 /srv/http/symfony/cmf-sandbox/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Container.php(33 in /srv/http/symfony/cmf-sandbox/vendor/symfony-cmf/routing/src/ChainRouter.php on line 101

The project uses a Symfony version 3 structure and may have some incompatibility with PHP 7.3 (as Timo says).

Answer 1

You can tell Composer to ignore the PHP version requirements by adding --ignore-platform-reqs to the composer create-project command.

Else, you'll probably have to wait until the dependencies of symfony-cmf/sandbox get bumped to a later version.

posted @   ldp.im  阅读(605)  评论(0编辑  收藏  举报
编辑推荐:
· 基于Microsoft.Extensions.AI核心库实现RAG应用
· Linux系列:如何用heaptrack跟踪.NET程序的非托管内存泄露
· 开发者必知的日志记录最佳实践
· SQL Server 2025 AI相关能力初探
· Linux系列:如何用 C#调用 C方法造成内存泄露
阅读排行:
· Manus爆火,是硬核还是营销?
· 终于写完轮子一部分:tcp代理 了,记录一下
· 别再用vector<bool>了!Google高级工程师:这可能是STL最大的设计失误
· 单元测试从入门到精通
· 震惊!C++程序真的从main开始吗?99%的程序员都答错了
历史上的今天:
2018-09-18 Unexpected end of JSON input while parsing near
点击右上角即可分享
微信分享提示