无法执行bin / console原则:migrations:migrate RuntimeException /vendor/symfony/console/Helper/QuestionHelper.php:129

时间:2019-02-10 12:28:46

标签: symfony4 doctrine-migrations

我第一次使用rsync将Symfony 4应用程序部署到生产环境中。

然后我尝试运行doctrine:migrations:migrate命令。

php -v:PHP 5.6.40

CentOS:7.6

EasyApache4

执行时:

bin/console doctrine:migrations:migrate

我收到以下错误:

Fatal error: Default value for parameters with a class type hint can only be NULL in /home/simpleit/ch.simpleitsolutions.bookings/vendor/symfony/console/Application.php on line 85

我了解Symfony 4 DoctrineMigrationsBundle需要PHP 7.1,因此我也尝试了以下操作:

/usr/bin/ea-php71 bin/console doctrine:migrations:migrate

我收到以下错误:

WARNING! You are about to execute a database migration that could result in schema changes and data loss. Are you sure you wish to continue? (y/n)[2019-02-10 12:10:52] console.ERROR: Error thrown while running command "{command}". Message: "{message}" {"exception":"[object] (Symfony\\Component\\Console\\Exception\\RuntimeException(code: 0): Aborted at /home/<account_dir>/vendor/symfony/console/Helper/QuestionHelper.php:129)","command":"doctrine:migrations:migrate","message":"Aborted"} []

提前谢谢

2 个答案:

答案 0 :(得分:1)

bin/console doctrine:migrations:migrate --no-interaction --allow-no-migration

答案 1 :(得分:0)

将PATH设置为php bin文件夹

env PATH="/opt/cpanel/ea-php71/root/usr/bin:$PATH" bin/console doctrine:migrations:migrate