我第一次使用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"} []
提前谢谢
答案 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