This repository has been archived by the owner on Jan 2, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 79
Fatal error: Class 'Symfony\Component\HttpKernel\Kernel' not found in {project directory}\symfony\app\AppKernel.php on line 7 #124
Comments
I am experiencing the same issue using the same versions (with a little tweaked worpdpress docker container) |
@daifabde I think that example of wordpress index.php is outdated or use something new in Symfony 3.x. Try the new index.php file. It worked for me: <?php
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\Debug\Debug;
use Symfony\Component\DependencyInjection\ContainerInterface;
/**
* Retrieves or sets the Symfony Dependency Injection container
*
* @param ContainerInterface|string $id
*
* @return mixed
*/
function symfony($id)
{
static $container;
if ($id instanceof ContainerInterface) {
$container = $id;
return;
}
return $container->get($id);
}
$loader = require __DIR__.'/../symfony/app/autoload.php';
require_once __DIR__.'/../symfony/app/bootstrap.php.cache';
// Load application kernel
require_once __DIR__.'/../symfony/app/AppKernel.php';
$sfKernel = new AppKernel('dev', true);
$sfKernel->loadClassCache();
$sfKernel->boot();
// Add Symfony container as a global variable to be used in Wordpress
$sfContainer = $sfKernel->getContainer();
if (true === $sfContainer->getParameter('kernel.debug', false)) {
Debug::enable();
}
symfony($sfContainer);
$sfRequest = Request::createFromGlobals();
$sfResponse = $sfKernel->handle($sfRequest);
$sfResponse->send();
$sfKernel->terminate($sfRequest, $sfResponse); As you will see the path to I hope that it solves your headaches |
As of 11/01/2017 and Symfony 3.3 :)
|
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Hello;
I'm interested in using symfony and Wordpress but at the first install a get this error
Fatal error: Class 'Symfony\Component\HttpKernel\Kernel' not found in {project directory}\symfony\app\AppKernel.php on line 7
My PHP version is 5.6
My symfony version is 2.8
My wordpress version is 4.6.1
The text was updated successfully, but these errors were encountered: