2014-10-11 2 views
2

내 환경을 dev에서 prod로 변경하려고합니다. prod env가있는 잘못된 경로로 가려고 할 때 "전자 메일 us ..."와 같은 오류 페이지 대신 dev 오류 페이지 "NotFoundHttpException :"이 표시됩니다.Symfony2 Production "404"

use Symfony\Component\ClassLoader\ApcClassLoader; 
use Symfony\Component\HttpFoundation\Request; 

$loader = require_once __DIR__.'/../app/bootstrap.php.cache'; 

// Use APC for autoloading to improve performance. 
// Change 'sf2' to a unique prefix in order to prevent cache key conflicts 
// with other applications also using APC. 
/* 
$apcLoader = new ApcClassLoader('sf2', $loader); 
$loader->unregister(); 
$apcLoader->register(true);*/ 

require_once __DIR__.'/../app/AppKernel.php'; 
require_once __DIR__.'/../app/AppCache.php'; 

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

// 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.php는

있다?

감사합니다, 아드리안 귀하의 app.php 파일이 new AppKernel('prod', true) 포함

+1

시도 : 생산 (이 또한 표준 버전의 기본입니다) 당신은 디버그가 활성화되지 않도록하려면 당신은 false로 설정하려는 AppKernel ('찌르다', 거짓); 캐시를 지우십시오. 그것이 도움이되는지 아닌지 확실하지 않습니다. – Cerad

답변

3

. 생성자의 두 번째 인수는 디버그 모드인지 여부를 결정합니다. 첫 번째 인수는 이름 만 결정하며, 환경 별 설정 파일을로드 할 때 사용할 수 있습니다.

디버그가 활성화되어 있으면 오류 페이지에 많은 정보가 담긴 자세한 버전이 표시되어 디버그 응용 프로그램을 사용할 수 있습니다.

// ... 
$kernel = new AppKernel('prod', false); 
// ...