0

Symfony bin/console throws the Symfony\Component\ErrorHandler\Error\UndefinedFunctionError when we try to execute a command on cPanel (but everything works on local server).

It produces an error because of the shell_exec function. It happens on the versions 6.1 and 6.2: Error Message -example of an executed command: "php bin/console list"


`Symfony\Component\ErrorHandler\Error\UndefinedFunctionError^ {#158
  #message: "Attempted to call function "shell_exec" from namespace "Symfony\Component\Console"."
  #code: 0
  #file: "./vendor/symfony/console/Application.php"
  #line: 981
  trace: {
    ./vendor/symfony/console/Application.php:981 { …}
    ./vendor/symfony/framework-bundle/Console/Application.php:97 { …}
    ./vendor/symfony/console/Application.php:301 { …}
    ./vendor/symfony/framework-bundle/Console/Application.php:80 { …}
    ./vendor/symfony/console/Application.php:171 { …}
    ./vendor/symfony/runtime/Runner/Symfony/ConsoleApplicationRunner.php:54 { …}
    ./vendor/autoload_runtime.php:29 { …}
    ./bin/console:11 {
      ›
      › require_once dirname(__DIR__).'/vendor/autoload_runtime.php';
      ›
      arguments: {
        "/home/***/****/vendor/autoload_runtime.php"
      }
    }
  }
}`

Symfony version and console version "symfony/console": "6.1.","symfony/framework-bundle": "6.1."

Php version: 8.1

NB: When we replace the shell_exec whith exec, it works as expected.

amine
  • 1
  • 1
  • There's a deleted answer talking about disabled functions and you have a response. Can you create a quick CLI script and [inspect the disabled functions](https://stackoverflow.com/a/3938155/231316). I know you said other commands work, but let's start here. – Chris Haas Feb 22 '23 at 14:30
  • Please edit the question to limit it to a specific problem with enough detail to identify an adequate answer. – Community Feb 22 '23 at 18:14

0 Answers0