Symfony控制台-未定义常量STDIN


Symfony Console - Undefined constant STDIN

我最近上传了我的symfony项目到我的webhost。当使用控制台时,每当我应该输入一些输入时,我都会得到以下错误:

Notice: Use of undefined constant STDIN - assumed 'STDIN' in 
/htdocs/symfony/vendor/symfony/symfony/src/Symfony/Component/Console/Helper/DialogHelper.php line 80

给出错误的文件在这里:

https://github.com/symfony/Console/blob/master/Helper/DialogHelper.php

第103行

我猜我的php配置是错误的。但是我不能完全控制服务器和它的设置。

我能做什么来解决这个问题吗?

直接添加:

define('STDIN',fopen("php://stdin","r"));

在/vendor/symfony/symfony/src/symfony/Component/Console/Helper/DialogHelper.php的顶部

    <?php
/*
 * This file is part of the Symfony package.
 *
 * (c) Fabien Potencier <fabien@symfony.com>
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */
namespace Symfony'Component'Console'Helper;
use Symfony'Component'Console'Output'OutputInterface;
use Symfony'Component'Console'Formatter'OutputFormatterStyle;
define('STDIN',fopen("php://stdin","r"));
...