2

Hopefully someone else has run into this problem. Just downloaded a Symfony project and I'm getting the above error message : "PHP Fatal error: Class 'Symfony\Component\HttpKernel\Kernel' not found in /Applications/MAMP/htdocs/myapp/app/AppKernel.php on line 7

I'm fairly new to setting up Symfony and here's what my app/autoload.php looks like:

<?php

use Doctrine\Common\Annotations\AnnotationRegistry;

$loader = require __DIR__.'/../vendor/autoload.php';


// intl
if (!function_exists('intl_get_error_code')) {
    require_once __DIR__.'/../vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/stubs/functions.php';
}

AnnotationRegistry::registerLoader(array($loader, 'loadClass'));

return $loader;

And here's what my app_dev.php file looks like:

#!/usr/bin/env php
<?php

// if you don't want to setup permissions the proper way, just uncomment the following  PHP line
 // read http://symfony.com/doc/current/book/installation.html#configuration-and-setup   for more information
umask(0000);

set_time_limit(0);

require_once __DIR__.'/bootstrap.php.cache';
require_once __DIR__.'/AppKernel.php';

use Symfony\Bundle\FrameworkBundle\Console\Application;
use Symfony\Component\Console\Input\ArgvInput;

$input = new ArgvInput();
$env = $input->getParameterOption(array('--env', '-e'), getenv('SYMFONY_ENV') ?: 'dev');
$debug = getenv('SYMFONY_DEBUG') !== '0' && !$input->hasParameterOption(array('--no-debug', '')) && $env !== 'prod';

$kernel = new AppKernel($env, $debug);
$application = new Application($kernel);
$application->run($input);

If anyone could point me in the right direction that would be great thanks!

5
  • symfony.com/doc/current/book/installation.html Commented Jan 19, 2014 at 1:27
  • 1
    What version of Symfony do you think you are using? Where did you download the project from? Your autoload sort of looks like S2.0. The other file sort of looks like a script of some kind? It's not the AppKernel file. Commented Jan 19, 2014 at 2:36
  • Hi @Cerad. I'm using version 2.4. This is a client project. And you are correct my mistake -- that's not the AppKernel file its the app_dev.php file. I've made the correction in the original. Commented Jan 19, 2014 at 2:41
  • @1ed Already have Symfony installed correctly. I can run the standard install just fine. Commented Jan 19, 2014 at 3:14
  • 1
    Based on the autolad file the project actually written for symfony <2.3, based on the console (not app_dev.php) file I would say it's a symfony 2.2 project. How did you get the vendor files (composer install)? You should have a composer.json file which looks like this. Commented Jan 19, 2014 at 18:07

3 Answers 3

3

Please try.

composer install

Sometimes it could be as simple as this.

Sign up to request clarification or add additional context in comments.

Comments

0

Try to add

$kernel = new AppKernel($env, $debug);
$kernel->loadClassCache();
$application = new Application($kernel);
$application->run($input);

Comments

0

Thanks guys for your help. Turns out that I had mucked up my Apache installation so that it wasn't finding the intl extension. Once I got that installed again everything is well.

1 Comment

On Debian this worked for me: printf "\n" | pecl install intl; echo -e "\nextension=intl.so" >> /usr/local/etc/php/php.ini

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.