duanji1043 2018-10-17 18:55
浏览 42

Doctrine:您错过了“cli-config.php”错误

I use doctrine for managing my database. Locally, I can run this command just fine:

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

However, after uploading the site to production, it returns this error:

/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);

However, this file already exists:

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

The directory structure is exactly the same in production as it is on my development server.

If I go to /var/www/vendor/doctrine/bin, and I then create the cli-config.php file inside that directory (which makes no sense), and then I run this:

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

Where should I look for this problem? PHP works just fine on the server, and if I manually create the database then the website using doctrine works just fine. I am suspicious about this line:

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

Not sure why that line is shown on the command line. Any ideas?

Note: I'm not using Symfony; just Doctrine.

  • 写回答

0条回答 默认 最新

    报告相同问题?

    悬赏问题

    • ¥15 mmocr的训练错误,结果全为0
    • ¥15 python的qt5界面
    • ¥15 无线电能传输系统MATLAB仿真问题
    • ¥50 如何用脚本实现输入法的热键设置
    • ¥20 我想使用一些网络协议或者部分协议也行,主要想实现类似于traceroute的一定步长内的路由拓扑功能
    • ¥30 深度学习,前后端连接
    • ¥15 孟德尔随机化结果不一致
    • ¥15 apm2.8飞控罗盘bad health,加速度计校准失败
    • ¥15 求解O-S方程的特征值问题给出边界层布拉休斯平行流的中性曲线
    • ¥15 谁有desed数据集呀