-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
[Process] defaultEnv not properly generated in PHP build-in webserver #44066
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
This might be the cause of the issue of the empty
So this might even effect other tools, not only the build-in webserver. For me |
Thanks for the quick commit f608f0b @nicolas-grekas but I do not think this solves the issue. e.g. |
Is that a guess or did you give it a try? To me it should fix the issue... :) |
I reimplemented it, you are right, it works like a charm. I did not expect that the intersection is empty. Thanks for the quick response! |
… (nicolas-grekas) This PR was merged into the 4.4 branch. Discussion ---------- [Process] intersect with getenv() to populate default envs | Q | A | ------------- | --- | Branch? | 4.4 | Bug fix? | yes | New feature? | no | Deprecations? | no | Tickets | Fix #44066 | License | MIT | Doc PR | - Commits ------- f608f0b [Process] intersect with getenv() to populate default envs
Symfony version(s) affected
process 5.3.7
Description
The php-doc says
symfony/src/Symfony/Component/Process/Process.php
Line 137 in f7d70f1
With
$env = null
it will take the Enviroment of the current process. This is not allways true.Using the PHP Build-In Webserver (
php -S localhost:80
)$_ENV
is empty (butgetenv()
is not), sosymfony/src/Symfony/Component/Process/Process.php
Line 1672 in f7d70f1
gives unexpected result. Especially the PATH variable remains unset, which leads to unfound binaries
How to reproduce
Use php build in webserver (see above) and use e.g
(set
$env = null
)-> PATH Variable is not set in
$_ENV
only ingetenv()
Possible Solution
Use
getEnv()
instead of$_ENV
or check forAdditional Context
php -S
is (often) used in local development environments. Missing PATH Variables can be a big issue there.The text was updated successfully, but these errors were encountered: