1

The project works in my local environment but when I deploy it on shared web server it doesn't work.

Server
 /home
   /app
   /src
      /gestor
        /UsuarioBundle
        ...   
   /vendors
   ....
 /public_html
   /web
   app.php
   ...

If I go to host/app.php -> Fatal error:
Class 'Gestor\UsuarioBundle\UsuarioBundle' not found in /home/esdrhazc/app/AppKernel.php on line 19

AppKernel.php

use Symfony\Component\HttpKernel\Kernel;
use Symfony\Component\Config\Loader\LoaderInterface;

class AppKernel extends Kernel
{
    public function registerBundles()
    {
        $bundles = array(
            new Symfony\Bundle\FrameworkBundle\FrameworkBundle(),
            new Symfony\Bundle\SecurityBundle\SecurityBundle(),
            new Symfony\Bundle\TwigBundle\TwigBundle(),
            new Symfony\Bundle\MonologBundle\MonologBundle(),
            new Symfony\Bundle\SwiftmailerBundle\SwiftmailerBundle(),
            new Symfony\Bundle\AsseticBundle\AsseticBundle(),
            new Doctrine\Bundle\DoctrineBundle\DoctrineBundle(),
            new Sensio\Bundle\FrameworkExtraBundle\SensioFrameworkExtraBundle(),
            new Gestor\UsuarioBundle\UsuarioBundle(),
            new Gestor\AdministracionBundle\AdministracionBundle(),
            new Gestor\ExpedientesBundle\ExpedientesBundle(),
            new Gestor\GestionBundle\GestionBundle(),
            new \Ideup\SimplePaginatorBundle\IdeupSimplePaginatorBundle(),
            new Gestor\MensajeBundle\MensajeBundle(),
            new Doctrine\Bundle\FixturesBundle\DoctrineFixturesBundle()
        );

        if (in_array($this->getEnvironment(), array('dev', 'test'))) {
            $bundles[] = new Symfony\Bundle\WebProfilerBundle\WebProfilerBundle();
            $bundles[] = new Sensio\Bundle\DistributionBundle\SensioDistributionBundle();
            $bundles[] = new Sensio\Bundle\GeneratorBundle\SensioGeneratorBundle();
        }

        return $bundles;
    }

    public function registerContainerConfiguration(LoaderInterface $loader)
    {
        $loader->load(__DIR__.'/config/config_'.$this->getEnvironment().'.yml');
    }
}

Autoload.php

use Doctrine\Common\Annotations\AnnotationRegistry;
use Composer\Autoload\ClassLoader;

/**
 * @var ClassLoader $loader
 */
$loader = require __DIR__.'/../vendor/autoload.php';

$loader->add('Gestor', __DIR__.'/../src');

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

return $loader;

And finally, for instance, class Usuario.php

namespace Gestor\UsuarioBundle\Entity;

...

class Usuario implements AdvancedUserInterface {...}

I have deleted server/app/cache and give permissions.

Thanks in advance!!!

3
  • 2
    maybe you need to change the folder 'gestor' to 'Gestor'? Commented Nov 2, 2013 at 21:34
  • it seems to work. Now, I have other issue: Fatal error: Class 'PDO' not found in /home/esdrhazc/vendor/doctrine/dbal/lib/Doctrine/DBAL/DriverManager.php on line 148 I will investigate. How can I vote you? To solve this I added extension=pdo.so extension=pdo_mysql.so in php.ini Commented Nov 2, 2013 at 21:44
  • Glad it helped! I made it an answer. Commented Nov 2, 2013 at 21:47

1 Answer 1

4

Change the folder 'gestor' to 'Gestor'

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

Comments

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.