前提:
官方 https://symfony.com/doc/master/cmf/quick_tour/the_big_picture.html#setting-up-the-database
由于
$ composer create-project symfony-cmf/sandbox cmf-sandbox
报错因此按照以下命令执行(上篇https://www.cnblogs.com/Amos-Turing/p/11541573.html)
https://github.com/symfony-cmf/standard-edition/releases
1:
composer create-project --ignore-platform-reqs symfony-cmf/sandbox cmf-sandbox
或者(我执行下面的成功了 参考:https://stackoverflow.com/questions/54000039/installing-symfony-project-with-php-7-3-version)
composer create-project --ignore-platform-reqs --stability=dev symfony-cmf/sandbox:dev-master cmf-sandbox
执行后如下:
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 Package operations: 111 installs, 0 updates, 0 removals - Installing twig/twig (v1.34.4): Loading from cache - Installing symfony/polyfill-util (v1.5.0): Loading from cache - Installing paragonie/random_compat (v2.0.10): Loading from cache - Installing symfony/polyfill-php70 (v1.5.0): Loading from cache - Installing symfony/polyfill-php56 (v1.5.0): Loading from cache - Installing symfony/polyfill-mbstring (v1.5.0): Loading from cache - Installing symfony/symfony (v3.3.6): Loading from cache
。。。。
Creating the "app/config/parameters.yml" file Some parameters are missing. Please provide them. locale (en): locales ([en, fr, de]): secret (ThisTokenIsNotSoSecretChangeIt): dsfkdsahflkdsahfkdsafjdsafkdsajfh coffee.extension (\.coffee-disabled$): coffee.bin (''): coffee.node (''): database_driver (pdo_sqlite): database_host (null): database_port (null): database_name (null): database_user (null): database_password (null): database_path ('%kernel.root_dir%/../var/app.sqlite'): mailer_transport (smtp): mailer_host (localhost): mailer_user (null): mailer_password (null): Creating the "app/config/phpcr.yml" file Some parameters are missing. Please provide them. phpcr_backend ({ logging: true, profiling: true, type: doctrinedbal, connection: default, caches: { meta: doctrine_cache.providers.phpcr_meta, nodes: doctrine_c ache.providers.phpcr_nodes }, parameters: { jackalope.check_login_on_server: fal se } }): phpcr_workspace (default): phpcr_user (admin): phpcr_pass (admin): > Sensio\Bundle\DistributionBundle\Composer\ScriptHandler::buildBootstrap > Sensio\Bundle\DistributionBundle\Composer\ScriptHandler::clearCache Fatal error: Uncaught Symfony\Component\Debug\Exception\ContextErrorException: W arning: count(): Parameter must be an array or an object that implements Countab le in E:\_My_File_____\_work\MyCode\Symfony\cmf-sandbox\vendor\symfony-cmf\routi ng\src\ChainRouter.php:101 Stack trace: #0 E:\_My_File_____\_work\MyCode\Symfony\cmf-sandbox\vendor\symfony-cmf\routing\ src\ChainRouter.php(308): Symfony\Cmf\Component\Routing\ChainRouter->all() #1 E:\_My_File_____\_work\MyCode\Symfony\cmf-sandbox\var\cache\dev\appDevDebugPr ojectContainer.php(1670): Symfony\Cmf\Component\Routing\ChainRouter->setContext( Object(Symfony\Component\Routing\RequestContext)) #2 E:\_My_File_____\_work\MyCode\Symfony\cmf-sandbox\vendor\symfony\symfony\src\ Symfony\Component\DependencyInjection\Container.php(335): appDevDebugProjectCont ainer->getCmfRouting_RouterService() #3 E:\_My_File_____\_work\MyCode\Symfony\cmf-sandbox\var\cache\dev\appDevDebugPr ojectContainer.php(1106): Symfony\Component\DependencyInjection\Container->get(' cmf_routing.rou...') #4 E:\_My_File in E:\_My_File_____\_work\MyCode\Symfony\cmf-sandbox\vendor\symfo ny-cmf\routing\src\ChainRouter.php on line 101 PHP Fatal error: Uncaught Symfony\Component\Debug\Exception\ContextErrorExcepti on: Warning: count(): Parameter must be an array or an object that implements Co untable in E:\_My_File_____\_work\MyCode\Symfony\cmf-sandbox\vendor\symfony-cmf\ routing\src\ChainRouter.php:101 Stack trace: #0 E:\_My_File_____\_work\MyCode\Symfony\cmf-sandbox\vendor\symfony-cmf\routing\ src\ChainRouter.php(308): Symfony\Cmf\Component\Routing\ChainRouter->all() #1 E:\_My_File_____\_work\MyCode\Symfony\cmf-sandbox\var\cache\dev\appDevDebugPr ojectContainer.php(1670): Symfony\Cmf\Component\Routing\ChainRouter->setContext( Object(Symfony\Component\Routing\RequestContext)) #2 E:\_My_File_____\_work\MyCode\Symfony\cmf-sandbox\vendor\symfony\symfony\src\ Symfony\Component\DependencyInjection\Container.php(335): appDevDebugProjectCont ainer->getCmfRouting_RouterService() #3 E:\_My_File_____\_work\MyCode\Symfony\cmf-sandbox\var\cache\dev\appDevDebugPr ojectContainer.php(1106): Symfony\Component\DependencyInjection\Container->get(' cmf_routing.rou...') #4 E:\_My_File in E:\_My_File_____\_work\MyCode\Symfony\cmf-sandbox\vendor\symfo ny-cmf\routing\src\ChainRouter.php on line 101 Script Sensio\Bundle\DistributionBundle\Composer\ScriptHandler::clearCache handl ing the post-install-cmd event terminated with an exception [RuntimeException] An error occurred when executing the ""cache:clear --no-warmup"" command: Fatal error: Uncaught Symfony\Component\Debug\Exception\ContextErrorExcepti on: Warning: count(): Parameter must be an array or an object that implemen ts Countable in E:\_My_File_____\_work\MyCode\Symfony\cmf-sandbox\vendor\sy mfony-cmf\routing\src\ChainRouter.php:101 Stack trace: #0 E:\_My_File_____\_work\MyCode\Symfony\cmf-sandbox\vendor\symfony-cmf\rou ting\src\ChainRouter.php(308): Symfony\Cmf\Component\Routing\ChainRouter->a ll() #1 E:\_My_File_____\_work\MyCode\Symfony\cmf-sandbox\var\cache\dev\appDevDe bugProjectContainer.php(1670): Symfony\Cmf\Component\Routing\ChainRouter->s etContext(Object(Symfony\Component\Routing\RequestContext)) #2 E:\_My_File_____\_work\MyCode\Symfony\cmf-sandbox\vendor\symfony\symfony \src\Symfony\Component\DependencyInjection\Container.php(335): appDevDebugP rojectContainer->getCmfRouting_RouterService() #3 E:\_My_File_____\_work\MyCode\Symfony\cmf-sandbox\var\cache\dev\appDevDe bugProjectContainer.php(1106): Symfony\Component\DependencyInjection\Contai ner->get('cmf_routing.rou...') #4 E:\_My_File in E:\_My_File_____\_work\MyCode\Symfony\cmf-sandbox\vendor\ symfony-cmf\routing\src\ChainRouter.php on line 101 PHP Fatal error: Uncaught Symfony\Component\Debug\Exception\ContextErrorEx ception: Warning: count(): Parameter must be an array or an object that imp lements Countable in E:\_My_File_____\_work\MyCode\Symfony\cmf-sandbox\vend or\symfony-cmf\routing\src\ChainRouter.php:101 Stack trace: #0 E:\_My_File_____\_work\MyCode\Symfony\cmf-sandbox\vendor\symfony-cmf\rou ting\src\ChainRouter.php(308): Symfony\Cmf\Component\Routing\ChainRouter->a ll() #1 E:\_My_File_____\_work\MyCode\Symfony\cmf-sandbox\var\cache\dev\appDevDe bugProjectContainer.php(1670): Symfony\Cmf\Component\Routing\ChainRouter->s etContext(Object(Symfony\Component\Routing\RequestContext)) #2 E:\_My_File_____\_work\MyCode\Symfony\cmf-sandbox\vendor\symfony\symfony \src\Symfony\Component\DependencyInjection\Container.php(335): appDevDebugP rojectContainer->getCmfRouting_RouterService() #3 E:\_My_File_____\_work\MyCode\Symfony\cmf-sandbox\var\cache\dev\appDevDe bugProjectContainer.php(1106): Symfony\Component\DependencyInjection\Contai ner->get('cmf_routing.rou...') #4 E:\_My_File in E:\_My_File_____\_work\MyCode\Symfony\cmf-sandbox\vendor\ symfony-cmf\routing\src\ChainRouter.php on line 101 create-project [-s|--stability STABILITY] [--prefer-source] [--prefer-dist] [--r epository REPOSITORY] [--repository-url REPOSITORY-URL] [--dev] [--no-dev] [--no -custom-installers] [--no-scripts] [--no-progress] [--no-secure-http] [--keep-vc s] [--remove-vcs] [--no-install] [--ignore-platform-reqs] [--] [<package>] [<dir ectory>] [<version>]
建议大家使用php7.1
然后按照官方教程执行
https://symfony.com/doc/master/cmf/quick_tour/the_big_picture.html#setting-up-the-database