Skip to content

fix php startup errors when ini files contain environment variables#2252

Merged
henderkes merged 5 commits intomainfrom
fix/getenv-crash
Mar 8, 2026
Merged

fix php startup errors when ini files contain environment variables#2252
henderkes merged 5 commits intomainfrom
fix/getenv-crash

Conversation

@henderkes
Copy link
Contributor

@henderkes henderkes commented Mar 8, 2026

closes #2250, closes #2252

@henderkes henderkes requested a review from AlliBalliBaba March 8, 2026 04:57
@AlliBalliBaba
Copy link
Contributor

You can probably also move env initialization before sapi_startup or at the top of php_main

sapi_startup(&frankenphp_sapi_module);
.

Then they will be available during startup

@henderkes
Copy link
Contributor Author

You can probably also move env initialization before sapi_startup or at the top of php_main

sapi_startup(&frankenphp_sapi_module);

.
Then they will be available during startup

moved before frankenphp sapi startup

Co-authored-by: Kévin Dunglas <kevin@dunglas.fr>
Signed-off-by: Marc <m@pyc.ac>
@henderkes henderkes merged commit 5979b4d into main Mar 8, 2026
95 checks passed
@henderkes henderkes deleted the fix/getenv-crash branch March 8, 2026 15:28
@shyim
Copy link
Contributor

shyim commented Mar 9, 2026

Could we get an version tagged with this fix?

@henderkes
Copy link
Contributor Author

It's 4am in Europe currently, so you may have to wait a few hours.

dunglas pushed a commit that referenced this pull request Mar 9, 2026
Adds a test to reproduce #2254 and verify `opcache_preload` works as
intended with the changes from
#2252.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

FrankenPHP v1.12.0: HTTP server never starts - hangs in initPHPThreads/WaitFor (non-worker mode)

4 participants