The GROW team reported that they are unable to execute bin/epoetry on their server. I also successfully replicated the issue locally using the current 2.x branch and PHP 8.2.10 (ZTS or NTS). The failure appears to come from the usage of getenv to retrieve environment variables.
Steps to Reproduce
Navigate to ~/<dirs>/epoetry-client
Run bin/epoetry
Fatal error: Uncaught InvalidArgumentException: Invalid environment provided to "OpenEuropa\EPoetry\Console\AppKernel": the environment cannot be empty. in /home/devlin/Code/b4/ecphp/epoetry-client/vendor/symfony/http-kernel/Kernel.php:92
The issue appears to be related to calls made using getenv. This approach is generally discouraged as getenv and putenv are not thread-safe. The PHP community and developers often use superglobal variables $_ENV or $_SERVER to obtain environment variables.
For reference, the Symfony team has also transitioned to prioritizing superglobal variables for obtaining environment variables (see this commit).
Suggested Fix
Replace getenv calls with superglobal variables like $_ENV or $_SERVER where applicable.
Hi colleagues,
The GROW team reported that they are unable to execute
bin/epoetry
on their server. I also successfully replicated the issue locally using the current2.x
branch and PHP 8.2.10 (ZTS or NTS). The failure appears to come from the usage ofgetenv
to retrieve environment variables.Steps to Reproduce
~/<dirs>/epoetry-client
bin/epoetry
The issue appears to be related to calls made using
getenv
. This approach is generally discouraged asgetenv
andputenv
are not thread-safe. The PHP community and developers often use superglobal variables$_ENV
or$_SERVER
to obtain environment variables.For reference, the Symfony team has also transitioned to prioritizing superglobal variables for obtaining environment variables (see this commit).
Suggested Fix
getenv
calls with superglobal variables like$_ENV
or$_SERVER
where applicable.