如何调整app.php文件以部署Symfony2应用程序并获得最佳性能

如何调整app.php文件以部署Symfony2应用程序并获得最佳性能,php,symfony,deployment,apc,symfony-2.7,Php,Symfony,Deployment,Apc,Symfony 2.7,我将在几天内部署一个Symfony2应用程序,因此我要问一些关于app.php文件和设置正确的生产环境的问题。下面是默认的app.php文件内容: <?php use Symfony\Component\ClassLoader\ApcClassLoader; use Symfony\Component\HttpFoundation\Request; $loader = require_once __DIR__.'/../app/bootstrap.php.cache'; // Ena

我将在几天内部署一个Symfony2应用程序,因此我要问一些关于
app.php
文件和设置正确的生产环境的问题。下面是默认的
app.php
文件内容:

<?php

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

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

// Enable APC for autoloading to improve performance.
// You should change the ApcClassLoader first argument to a unique prefix
// in order to prevent cache key conflicts with other applications
// also using APC.
/*
$apcLoader = new ApcClassLoader(sha1(__FILE__), $loader);
$loader->unregister();
$apcLoader->register(true);
*/

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

$kernel = new AppKernel('prod', false);
$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);

如果你使用OPC:1.no,2.?,3.no,4.no。这很好,为什么要投反对票?这不是一个好问题?我没有被否决,只是回答问题,我认为在我们默认使用opc的情况下安装apc是不值得的。我现在投反对票:D@malcolmThx我没有说你是投反对票的人,而其他人没有读问题,至少试着告诉我为什么我错了,或者为什么他/她认为投反对票没问题如果你使用OPC:1.no,2.?,3.no,4.no。这很好,为什么投反对票?这不是一个好问题?我没有被否决,只是回答问题,我认为在我们默认使用opc的情况下安装apc是不值得的。我现在投反对票:D@malcolmThx我没有说你是投反对票的人,而其他人没有读问题,至少试着告诉我为什么我错了,或者为什么他/她认为投反对票是好的