-
-
Notifications
You must be signed in to change notification settings - Fork 9.7k
Closed
Description
Symfony version(s) affected
6.2.7
Description
Error message:
Error: Call to undefined function Symfony\Component\Console\shell_exec() in /{path_to_project}/vendor/symfony/console/Application.php:989
- https://github.com/symfony/console/blob/cbad09eb8925b6ad4fb721c7a179344dc4a19d45/Application.php#L989
Terminal:hasSttyAvailable()
checks for availability of exec
However, all calls inside the condition are then run using shell_exec
and that fails when it is disabled.
One might argue that it does not make much sense to have one function enabled and the other disabled, but apparently it can happen and then it fails.
Or am I missing something? :)
How to reproduce
Have a system, that has:
- exec enabled
- shell_exec disabled
- symfony/console installed
- symfony/events installed (otherwise checks for dispatcher fail and a different route in the code is taken that will not manifest the problem)
Then try to run the symfony console from command line.
Possible Solution
Either check availability of shell_exec
in Terminal::hasSttyAvailable()
or change all calls to use exec
.
Additional Context
The check has been introduced here: