前提:
官方 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): > SensioBundleDistributionBundleComposerScriptHandler::buildBootstrap > SensioBundleDistributionBundleComposerScriptHandler::clearCache Fatal error: Uncaught SymfonyComponentDebugExceptionContextErrorException: W arning: count(): Parameter must be an array or an object that implements Countab le in E:\_My_File_____\_workMyCodeSymfonycmf-sandboxvendorsymfony-cmf outi ngsrcChainRouter.php:101 Stack trace: #0 E:\_My_File_____\_workMyCodeSymfonycmf-sandboxvendorsymfony-cmf outing srcChainRouter.php(308): SymfonyCmfComponentRoutingChainRouter->all() #1 E:\_My_File_____\_workMyCodeSymfonycmf-sandboxvarcachedevappDevDebugPr ojectContainer.php(1670): SymfonyCmfComponentRoutingChainRouter->setContext( Object(SymfonyComponentRoutingRequestContext)) #2 E:\_My_File_____\_workMyCodeSymfonycmf-sandboxvendorsymfonysymfonysrc SymfonyComponentDependencyInjectionContainer.php(335): appDevDebugProjectCont ainer->getCmfRouting_RouterService() #3 E:\_My_File_____\_workMyCodeSymfonycmf-sandboxvarcachedevappDevDebugPr ojectContainer.php(1106): SymfonyComponentDependencyInjectionContainer->get(' cmf_routing.rou...') #4 E:\_My_File in E:\_My_File_____\_workMyCodeSymfonycmf-sandboxvendorsymfo ny-cmf outingsrcChainRouter.php on line 101 PHP Fatal error: Uncaught SymfonyComponentDebugExceptionContextErrorExcepti on: Warning: count(): Parameter must be an array or an object that implements Co untable in E:\_My_File_____\_workMyCodeSymfonycmf-sandboxvendorsymfony-cmf routingsrcChainRouter.php:101 Stack trace: #0 E:\_My_File_____\_workMyCodeSymfonycmf-sandboxvendorsymfony-cmf outing srcChainRouter.php(308): SymfonyCmfComponentRoutingChainRouter->all() #1 E:\_My_File_____\_workMyCodeSymfonycmf-sandboxvarcachedevappDevDebugPr ojectContainer.php(1670): SymfonyCmfComponentRoutingChainRouter->setContext( Object(SymfonyComponentRoutingRequestContext)) #2 E:\_My_File_____\_workMyCodeSymfonycmf-sandboxvendorsymfonysymfonysrc SymfonyComponentDependencyInjectionContainer.php(335): appDevDebugProjectCont ainer->getCmfRouting_RouterService() #3 E:\_My_File_____\_workMyCodeSymfonycmf-sandboxvarcachedevappDevDebugPr ojectContainer.php(1106): SymfonyComponentDependencyInjectionContainer->get(' cmf_routing.rou...') #4 E:\_My_File in E:\_My_File_____\_workMyCodeSymfonycmf-sandboxvendorsymfo ny-cmf outingsrcChainRouter.php on line 101 Script SensioBundleDistributionBundleComposerScriptHandler::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 SymfonyComponentDebugExceptionContextErrorExcepti on: Warning: count(): Parameter must be an array or an object that implemen ts Countable in E:\_My_File_____\_workMyCodeSymfonycmf-sandboxvendorsy mfony-cmf outingsrcChainRouter.php:101 Stack trace: #0 E:\_My_File_____\_workMyCodeSymfonycmf-sandboxvendorsymfony-cmf ou tingsrcChainRouter.php(308): SymfonyCmfComponentRoutingChainRouter->a ll() #1 E:\_My_File_____\_workMyCodeSymfonycmf-sandboxvarcachedevappDevDe bugProjectContainer.php(1670): SymfonyCmfComponentRoutingChainRouter->s etContext(Object(SymfonyComponentRoutingRequestContext)) #2 E:\_My_File_____\_workMyCodeSymfonycmf-sandboxvendorsymfonysymfony srcSymfonyComponentDependencyInjectionContainer.php(335): appDevDebugP rojectContainer->getCmfRouting_RouterService() #3 E:\_My_File_____\_workMyCodeSymfonycmf-sandboxvarcachedevappDevDe bugProjectContainer.php(1106): SymfonyComponentDependencyInjectionContai ner->get('cmf_routing.rou...') #4 E:\_My_File in E:\_My_File_____\_workMyCodeSymfonycmf-sandboxvendor symfony-cmf outingsrcChainRouter.php on line 101 PHP Fatal error: Uncaught SymfonyComponentDebugExceptionContextErrorEx ception: Warning: count(): Parameter must be an array or an object that imp lements Countable in E:\_My_File_____\_workMyCodeSymfonycmf-sandboxvend orsymfony-cmf outingsrcChainRouter.php:101 Stack trace: #0 E:\_My_File_____\_workMyCodeSymfonycmf-sandboxvendorsymfony-cmf ou tingsrcChainRouter.php(308): SymfonyCmfComponentRoutingChainRouter->a ll() #1 E:\_My_File_____\_workMyCodeSymfonycmf-sandboxvarcachedevappDevDe bugProjectContainer.php(1670): SymfonyCmfComponentRoutingChainRouter->s etContext(Object(SymfonyComponentRoutingRequestContext)) #2 E:\_My_File_____\_workMyCodeSymfonycmf-sandboxvendorsymfonysymfony srcSymfonyComponentDependencyInjectionContainer.php(335): appDevDebugP rojectContainer->getCmfRouting_RouterService() #3 E:\_My_File_____\_workMyCodeSymfonycmf-sandboxvarcachedevappDevDe bugProjectContainer.php(1106): SymfonyComponentDependencyInjectionContai ner->get('cmf_routing.rou...') #4 E:\_My_File in E:\_My_File_____\_workMyCodeSymfonycmf-sandboxvendor symfony-cmf outingsrcChainRouter.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