Skip to content

Cant find Symfony application AppKernel.php by apigility. #5

@vrkansagara

Description

@vrkansagara

I am accessing the http://apigility.local/post where I have successfully added the ApiBlog module from this repository.
and added Symfony application. file into PostResource.php under the __construct method as bellow

public function __construct()
    {
        $symfonyApp = '/home/vallabh/www/symfony2app';
        require_once $symfonyApp . '/app/AppKernel.php';

        $kernel = new \AppKernel('prod', true);
        $kernel->loadClassCache();
        $kernel->boot();

        $this->doctrine = $kernel->getContainer()
            ->get('doctrine')
            ->getManager();
    }

But still error showing.

I have tested that AppKernel.php is successfully called into the __construct but while accessing the
api get request http://apigility.local/post thowring the errors as bellow.

Fatal error: Class 'Symfony\Component\HttpKernel\Kernel' not found in /home/vallabh/www/symfony2app/app/AppKernel.php on line 7

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions