【问题标题】:ZF2 + Composer + Doctrine in JelasticZF2 + Composer + Jelastic 中的教义
【发布时间】:2015-02-17 12:36:24
【问题描述】:

我在使用 Doctrine 和 Jelastic 时遇到问题。

显示问题:

“警告:require_once(/vendor/doctrine/orm/lib/Doctrine/ORM/Mapping/Driver/DoctrineAnnotations.php”):无法打开流:/var/www/webroot/ROOT 中没有这样的文件或目录/vendor/doctrine/annotations/lib/Doctrine/Common/Annotations/AnnotationRegistry.php 第 64 行致命错误:require_once (): Failed opening require ' /vendor/doctrine/orm/lib/Doctrine/ORM/Mapping/Driver/DoctrineAnnotations .php' (include_path = '.:/usr/share/pear') 在 /var/www/webroot/ROOT/vendor/doctrine/annotations/lib/Doctrine/Common/Annotations/AnnotationRegistry.php 第 64 行。

以下网址问题:http://temprafesta.jelasticls.com.br/

我已经通过 SSH 安装了 ZF2 + Composer 及其依赖项。成功发生,但是当我与教义约会时出现此错误。

有人可以帮忙吗?

亲切的问候, 艾伦。

【问题讨论】:

    标签: php orm doctrine-orm zend-framework2 composer-php


    【解决方案1】:

    从给定的错误中可以清楚地看出,基本路径没有被考虑在内。可能这是 Doctrine 中的一个错误。您是否能够查看另一个版本的 Doctrine?

    【讨论】:

    • 我通过 SSH Composer 安装了 Doctrine,得到了最新版本。奇怪的是本地工作,但是当我迁移到服务器时,Doctrine 出现了这个错误。
    • 数字中的“最新版本”是多少?究竟是哪个版本?
    【解决方案2】:

    嗯,发出该错误的文件就是这个:

    https://github.com/doctrine/annotations/blob/master/lib/Doctrine/Common/Annotations/AnnotationRegistry.php#L64

    /**
     * Registers file.
     *
     * @param string $file
     *
     * @return void
     */
    static public function registerFile($file)
    {
        require_once $file;
    }
    

    我不知道为什么有人要调用这个方法,但只有两种情况:要么是 Doctrine 内部的代码,要么是你的代码。

    我没有找到太多教义调用这个函数的地方,但听起来就是这样:

    https://github.com/doctrine/doctrine2/blob/664b6bf4c52c893011ec4b7b3c99e94399ed0316/lib/Doctrine/ORM/Configuration.php#L153

    现在的问题是:为什么__DIR__ 被评估为/vendor/doctrine/orm/lib/Doctrine/ORM?这是没有意义的,除非 PHP 因为任何花哨的文件系统的东西而感到困惑。我建议深入研究这部分并在那里添加一些调试输出,以确保一切都按预期工作。我认为没有。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2014-11-06
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2014-10-14
      • 2014-09-19
      • 2013-01-13
      相关资源
      最近更新 更多