首页 > 解决方案 > 生产错误:/app/app/config/routing.yml

问题描述

我有一个 Symfony 3.3 项目。在我的 debian local 上,一切正常。

但是在生产中......我有这个错误: 文件“/home/blabla/app/app/config/routing.yml”不存在。

我的主机配置为指向 /web 文件夹。/web 文件夹的 .htaccess 是 Symfony 提供的原始文件。

这是我的 app.php 文件:

<?php

use Symfony\Component\HttpFoundation\Request;

require __DIR__.'/../vendor/autoload.php';

if (PHP_VERSION_ID < 70000) {
    include_once __DIR__.'/../var/bootstrap.php.cache';
}

$kernel = new AppKernel('prod', false);
if (PHP_VERSION_ID < 70000) {
    $kernel->loadClassCache();
}

//$kernel = new AppCache($kernel);
$kernel = new AppKernel('prod', true);


// When using the HttpCache, you need to call the method in your front controller instead of relying on the configuration parameter
//Request::enableHttpMethodParameterOverride();
$request = Request::createFromGlobals();
$response = $kernel->handle($request);
$response->send();
$kernel->terminate($request, $response);

真的需要帮助,谢谢!

标签: symfonyproduction

解决方案


问题出在 .. app/app /config/routing.yml..

对我来说,这发生在我删除 composer(json,lock) 和 package(json) 文件时。当您保留它们时,一切都会按预期工作。


推荐阅读