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

Shopware 6.5(DDEV环境)Twig异常无法显示错误页面

Shopware 6.5(DDEV+Symfony Flex)Twig模板异常显示空白页面问题
  • 使用Symfony Flex模板通过DDEV初始化Shopware 6.5新项目后,普通PHP异常可正常渲染错误页面,但Twig模板语法错误(例如将if误写为iff)时,前端仅显示空白页面,正确的错误信息仅记录在服务器日志中。

复现用DDEV配置(config.yaml)

name: shopware-project
type: shopware6
docroot: public
php_version: "8.1"
developer_mode: true
webserver_type: apache-fpm
router_http_port: "80"
router_https_port: "443"
xdebug_enabled: true
additional_hostnames: []
additional_fqdns: []
database:
    type: mariadb
    version: "10.4"
nfs_mount_enabled: false
mutagen_enabled: false
use_dns_when_possible: false
composer_version: "2"
web_environment: []
nodejs_version: "16"
disable_settings_management: true

排查情况

  • 通过XDebug定位到问题出在vendor/symfony/http-foundation/Response.php的Response类中,取消注释第422行的$this->sendHeaders();后,错误页面可正常显示,推测问题与DDEV服务器配置相关。
  • 将同一项目在MAMP中运行(数据库一致)时,错误页面显示正常,且对比发现DDEV容器与MAMP服务器的响应头无差异。

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

相关产品推荐
方舟 Agent Plan

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

最近更新时间:2026.07.16 04:16:00