Symfony apcu class loader not found, upgrade from 2.8 to 3.4

  apcu, php, symfony

I’ve upgraded from Symfony version 2.8 to 3.4 everything worked fine locally, but this may be because it was using app_dev.php however in production I get

PHP Fatal error: Uncaught Error: Class 'SymfonyComponentClassLoaderApcClassLoader' not found in web/app.php 

However this file is there in the vendor folder. It could be that my configuration of app.php is from 2.8 as below, how would I change this work with apcu cache, which I’m aware is deprecated, but currently my caching relies a lot on this.

use SymfonyComponentClassLoaderApcClassLoader;
use SymfonyComponentHttpFoundationRequest;

$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('123456etc', $loader);


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

$kernel = new AppKernel('prod',true);
$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 = Request::createFromGlobals();
$response = $kernel->handle($request);
$kernel->terminate($request, $response);

Source: Symfony Questions