使用PHP 7.3版本安装Symfony项目

时间:2019-01-02 00:31:38

标签: php symfony

尝试安装(以及在更新作曲家之后):

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].

我有那些错误:

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

编辑:继续Timo的建议,我能够通过执行以下操作安装项目:

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

但是我得到了以下错误:

seaborn

该项目使用Symfony版本3结构,并且可能与PHP 7.3不兼容(如Timo所说)。

1 个答案:

答案 0 :(得分:2)

您可以通过在--ignore-platform-reqs命令中添加composer create-project来告诉Composer忽略PHP版本要求。

否则,您可能必须等到symfony-cmf/sandbox的依赖项升格到更高版本。

编辑:如果最新版本的Symfony CMF Sandbox尚不可用,您可以尝试使用主版本(最新未发布的更改)来查看是否已解决。您可以通过在--stability=dev命令中添加composer create-project并使用symfony-cmf/sandbox:dev-master作为源来做到这一点: composer create-project --ignore-platform-reqs --stability=dev symfony-cmf/sandbox:dev-master cmf-sandbox