Symfony Console - Undefined constant STDIN

I recently uploaded my symfony project to my web host. When using the console, I get the following error when Im should enter some input.

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

The file that gives the error is here:

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

Line 103

I assume my php configuration is somehow wrong. However, I do not have full control over the server and its settings.

Is there anything I can do to fix the problem?

+4
source share
1 answer

just add:

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

at the top of /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")); ... 
+3
source

All Articles