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.