class_exist fails on production server but not on development environment

Permalink
Server and environment settings are pretty much the same.

Vagrant for development

and AWS Ubuntu for production.

Route::Register('/resource/{resource}',function($resource) {
    $classname = '\Application\Controller\Resource\\'. ucwords($resource);
    if (class_exists($classname)) {
        /** @var \Application\Src\Rest\Controller $instance */
        $instance = new $classname();
        $instance->dispatch(null);
    } else {
        throw new \Exception('No REST endpoint exists for '.$classname);
    }
});


Not sure why this is failing.