Symfony - controller not found

I’m new to symfony and having issues createing and running new controllers.

I have two other controllers and they work fine but for some reason I can seem to create any new controllers with out it throughing out a error message.

The new controller also prevents the other controllers from working but if i delete the new controller the other two controllers work.

I recreated the route, the controller and still no go.
cleared the cache with no success.

any ideas

Compile Error: Symfony\Component\Debug\DebugClassLoader::loadClass(): Failed opening required ‘/home/test/webhtdocs/symfony/project1/src/AppBundle/Controller/ContactController.php’ (include_path=‘.:/usr/share/php:/usr/share/pear’)

    path: /contact
    defaults: { _controller:AppBundle:Contact:index }


namespace AppBundle\Controller;

use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route;
use Symfony\Bundle\FrameworkBundle\Controller\Controller;

class ContactController extends Controller
    public function indexAction()
        return $this->render('AppBundle:forms:homepage.html.twig');

Hi Robin,

My first thought is that this class should be called ContactController, as that seems to be what you’ve got specified in your route. However, the error message indicated that the autoloader is looking for the file SbcontactController.php but I’m not sure why that would be?

Hi Fretburner,

I’m so sorry i copy/pasted the wrong code. your right it should be ContactController, corrections were made to my original post and error still remains.

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.