You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

Symfony 6《快速入门》示例运行问题:路径含symfony致安装失败

Symfony Fast Track项目安装异常:父目录含'symfony'引发的系列问题及解决

问题场景

执行《Symfony: The Fast Track》的项目初始化步骤时,运行命令:

symfony new --version=6.2-1 --book guestbook

若项目的父文件夹名称包含symfony字样,会触发全程安装异常,无法推进后续操作;但在~/projects这类不含symfony关键词的目录下执行命令,所有步骤均正常。

报错汇总

  • Git标签缺失
  • Blackfire服务启动报错:
    ERROR: for guestbook_blackfire_1 Cannot start service blackfire: cgroups: cgroup mountpoint does not exist: unknown
    
  • OCI运行时创建失败:
    Cannot start service blackfire: OCI runtime create failed: container with id exists: ...
    
  • 数据库连接拒绝:
    An exception occurred in the driver: SQLSTATE[08006] [7] connection to server at "127.0.0.1", port 5432 failed: Connection refused Is the server running on that host and accepting TCP/IP connections?
    
  • docker-compose up -d多服务启动失败:
    docker-compose up -d
    Building with native build. Learn about native build in Compose here: https://docs.docker.com/go/compose-native-build/
    Starting guestbook_mailer_1    ... error
    Starting guestbook_database_1 ... 
    Starting guestbook_blackfire_1 ... 
    Starting guestbook_database_1  ... error
    ERROR: for guestbook_mailer_1  Cannot start service mailer: cgroups: cgroup mountpoint does not exist: unknown
    
    Starting guestbook_blackfire_1 ... error
    
    ERROR: for guestbook_blackfire_1  Cannot start service blackfire: cgroups: cgroup mountpoint does not exist: unknown
    
    ERROR: for mailer  Cannot start service mailer: cgroups: cgroup mountpoint does not exist: unknown
    
    ERROR: for database  Cannot start service database: cgroups: cgroup mountpoint does not exist: unknown
    
    ERROR: for blackfire  Cannot start service blackfire: cgroups: cgroup mountpoint does not exist: unknown
    ERROR: Encountered errors while bringing up the project.
    

已尝试的无效修复手段

  • 删除Docker容器、镜像后重新构建
  • 执行cgroup挂载命令:
    sudo mkdir /sys/fs/cgroup/systemd
    sudo mount -t cgroup -o none,name=systemd cgroup /sys/fs/cgroup/systemd
    
  • 多次重复执行手册到第8步的所有流程
  • 迁移Git仓库并手动移动.git目录以修复标签缺失问题
  • 查阅技术社区帖子尝试其他常规方案

最终解决方法

保证项目的完整路径中不包含symfony字样,将项目迁移到不含该关键词的目录(如~/projects)后重新执行初始化命令,所有异常均消失,安装及后续步骤顺利完成。

内容的提问来源于stack exchange,提问作者VladSavitsky

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.08.02 21:41:11