symfony - 生产错误:/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);
真的需要帮助,谢谢!
解决方案
问题出在 .. app/app /config/routing.yml..
对我来说,这发生在我删除 composer(json,lock) 和 package(json) 文件时。当您保留它们时,一切都会按预期工作。
推荐阅读
- hibernate - How can I change DiscriminatorValue of entity
- nginx - nginx error : The 'Access-Control-Allow-Origin' header contains multiple values
- python - 导入呈现语句抛出“没有这样的模块”错误
- mongodb - Creating a database and collection programmatically for Azure Cosmos DB via Mongo DB .NET Driver
- c++ - Algorithm to edit a complex line in a 2D- Array needed
- java - Add multiple values on a table using docx4j
- java - XSSFRichTextString with mixed font ignores newline after bold font only
- python-3.x - Scrapy - 以时间间隔运行
- java - TernaryOperator (? :) 用于 Java 函数。我们能离多近?
- adonis.js - 变量包含多个对象如何将其返回为多个对象的对象