Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Allow usage of environment variables in PHP ini settings that contain byte size values #544

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

Open
graste wants to merge 1 commit into reactphp:3.x
base: 3.x
Choose a base branch
Loading
from graste:ini-size-with-env-var

Conversation

@graste
Copy link

@graste graste commented May 26, 2025
edited
Loading

I ran into a problem where the IniUtil::iniSizeToBytes function threw errors due to the usage of environment variables inside PHP ini settings to configure size values.

Example:

memory_limit=${PHP_MEMORY_LIMIT}
post_max_size=$PHP_POST_MAX_SIZE

This might be used e.g. in docker setups where the container gets post_max_size, memory_limit etc values via environment variables instead of providing different ini files per environments via mounts.

I suggest the changes within this pull request. I didn't add a changelog entry, as I don't know your rules for this. The used regular expression should work w/ PCRE and PCRE2 if I'm not mistaken. I didn't verify performance aspects, but usage of the function seems to be in constructors only. PS: That last string cast is not phpstan level 10 compatible. 🗡️

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

No reviews

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

1 participant

AltStyle によって変換されたページ (->オリジナル) /