0

我试图在我的生产服务器中部署一个 Symfony2 应用程序,但我一直收到这个错误:

[Wed Aug 21 13:34:09 2013] [error] [client 217.116.1.71] PHP Fatal error:  Class 'FEB\\UserBundle\\FEBUserBundle' not found in /var/www/social-apps-nt.com/public_html/FEB/app/AppKernel.php on line 20
[Wed Aug 21 13:34:10 2013] [error] [client 217.116.1.71] PHP Warning:  include(/var/www/social-apps-nt.com/public_html/FEB/src/FEB/UserBundle/FEBUserBundle.php): failed to open stream: Permission denied in /var/www/social-apps-nt.com/public_html/FEB/vendor/composer/ClassLoader.php on line 185

这是我的 appKernel.php

<?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 FOS\UserBundle\FOSUserBundle(),
            new FEB\UserBundle\FEBUserBundle(),
            new FEB\TwitterBundle\FEBTwitterBundle(),
            new FEB\FacebookBundle\FEBFacebookBundle(),
            new FEB\CMSBundle\FEBCMSBundle(),
            new FEB\TagsBundle\FEBTagsBundle(),
            new FEB\YoutubeBundle\FEBYoutubeBundle(),
            new Knp\Bundle\PaginatorBundle\KnpPaginatorBundle(),
            new Stfalcon\Bundle\TinymceBundle\StfalconTinymceBundle(),
            new FEB\DownloadableBundle\FEBDownloadableBundle(),
            new FEB\EmbeddableBundle\FEBEmbeddableBundle()
        );

        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');
    }
}

并且文件夹和类位于正确的位置和文件夹中。

似乎找不到我的自定义捆绑包,因为如果我更改行总是会在第 20 行抛出错误。

任何帮助,请???

提前谢谢你。

4

1 回答 1

0

关键是错误消息中的“Permission denied”,这意味着它无法打开文件。

检查文件的所有者和 chmod 是否正常,chmod 755 在大多数情况下听起来很合理。您可以通过chmod 755 -R src在基于 Linux 的系统上运行来更改它,同时确保您的网络服务器用户有权访问这些文件。

于 2013-08-21T12:20:48.177 回答