该项目在我的本地环境中工作,但是当我在共享的Web服务器上部署它时,它不起作用。
Server
/home
/app
/src
/gestor
/UsuarioBundle
...
/vendors
....
/public_html
/web
app.php
...
如果我去主持人/ app.php - >
致命错误:
第19行的/home/esdrhazc/app/AppKernel.php中找不到“Gestor \ UsuarioBundle \ UsuarioBundle”类
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;
最后,例如,类Usuario.php
namespace Gestor\UsuarioBundle\Entity;
...
class Usuario implements AdvancedUserInterface {...}
我删除了服务器/ app / cache并授予权限。
提前致谢!!!
答案 0 :(得分:4)
将文件夹'gestor'更改为'Gestor'