教义:您缺少“ cli-config.php”错误

时间:2018-10-17 18:55:59

标签: php doctrine-orm

我使用原则来管理我的数据库。在本地,我可以很好地运行此命令:

vendor / bin / doctrine orm:schema-tool:update --force --dump-sql

但是,将网站上传到生产环境后,它将返回此错误:

/var/www $ vendor/bin/doctrine orm:schema-tool:update --force --dump-sql
Content-type: text/html; charset=UTF-8

You are missing a "cli-config.php" or "config/cli-config.php" file in your
project, which is required to get the Doctrine Console working. You can use the
following sample as a template:

<?php
use Doctrine\ORM\Tools\Console\ConsoleRunner;

// replace with file to your own project bootstrap
require_once 'bootstrap.php';

// replace with mechanism to retrieve EntityManager in your app
$entityManager = GetEntityManager();

return ConsoleRunner::createHelperSet($entityManager);

但是,该文件已经存在:

/var/www $ cat cli-config.php 
<?php
require_once 'functions.php';
use Doctrine\ORM\Tools\Console\ConsoleRunner;
return ConsoleRunner::createHelperSet($db);

生产中的目录结构与开发服务器上的目录结构完全相同。

如果我转到/ var / www / vendor / doctrine / bin,然后在该目录中创建cli-config.php文件(没有任何意义),然后运行此文件:

/var/www $ vendor/bin/doctrine orm:schema-tool:update --force --dump-sql
Status: 500 Internal Server Error
Content-type: text/html; charset=UTF-8

我应该在哪里寻找这个问题? PHP在服务器上运行正常,如果我手动创建数据库,则使用主义的网站也可以正常运行。我对此行表示怀疑:

Content-type: text/html; charset=UTF-8

不确定为什么在命令行中显示该行。有什么想法吗?

注意:我不使用Symfony;只是教义。

0 个答案:

没有答案