替换并添加后$loader = new ApcClassLoader('tcs_beta_prod', $loader);
我
$loader = new XcacheClassLoader('tcs_beta_prod', $loader);
有use Symfony\Component\ClassLoader\XcacheClassLoader;
这个错误Fatal error: Class 'Symfony\Component\ClassLoader\XcacheClassLoader' not found in C:\xampp\htdocs\edt\web\app.php on line 11
。这是我的 app.php
<?php
use Symfony\Component\ClassLoader\XcacheClassLoader;
use Symfony\Component\HttpFoundation\Request;
$loader = require_once __DIR__.'/../app/bootstrap.php.cache';
// Use APC for autoloading to improve performance
// Change 'sf2' by the prefix you want in order to prevent key conflict with another application
$loader = new XcacheClassLoader('tcs_beta_prod', $loader);
$loader->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);
$request = Request::createFromGlobals();
Request::setTrustedProxies(array($request->server->get('REMOTE_ADDR'))); // per suggestion from Farid / Patrick to deal with ELB proxying
$response = $kernel->handle($request);
$response->send();
$kernel->terminate($request, $response);