Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/243.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Php 无法在条令中使用类加载器。没有这样的文件或目录_Php_Doctrine Orm - Fatal编程技术网

Php 无法在条令中使用类加载器。没有这样的文件或目录

Php 无法在条令中使用类加载器。没有这样的文件或目录,php,doctrine-orm,Php,Doctrine Orm,我试图在linux服务器上使用条令,但发现很难开始使用 我有以下文件夹结构 /var/www init.php /database /entities Template.php init.php的内容: <?php $classLoader = new \Doctrine\Common\ClassLoader('Entities', __DIR__."/database"); $classLoader->register(); ?>

我试图在linux服务器上使用条令,但发现很难开始使用

我有以下文件夹结构

/var/www
init.php
/database
    /entities
        Template.php
init.php的内容:

<?php
$classLoader = new \Doctrine\Common\ClassLoader('Entities', __DIR__."/database");
$classLoader->register();
?>
这一切都很好。

名称空间实体

应该是小写

名称空间实体

然后它在Linux中运行良好

<?php
namespace Entities;

/** @Entity **/
class Template {
    ...
}
?>
    $classLoader = new \Doctrine\Common\ClassLoader('Entities', __DIR__."//database//");