Repository navigation
[2.x] fix: Detect the web memory limit from Debian/Ubuntu's FPM conf.d - #4991
Merged
Merged
Conversation
flarum info reports the web SAPI's memory_limit by scanning a fixed list
of config files. On Debian and Ubuntu the real value is usually set in
/etc/php/{version}/fpm/conf.d/, which the list never covered, so it fell
back to the base php.ini value and reported a limit far below the real
one. That output is what people paste into support threads, so a wrong
figure sends diagnosis down the wrong path.
Scan the fpm conf.d directories too, keeping the last match in name order
to mirror how PHP loads them. The file and directory lists are now their
own methods so the detection can be tested against fixtures.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Changes proposed in this pull request:
flarum inforeports the web SAPI'smemory_limitby scanning a fixed list of config files and one hard-coded conf.d directory (/usr/local/etc/php/conf.d, the Docker layout). On Debian and Ubuntu the effective value is usually set in/etc/php/{version}/fpm/conf.d/— which nothing in the list covered — so the detection fell through to the basephp.inivalue and reported a figure well below the real one (a report in the wild: "Web: 128M" shown against a real 512M).That output is exactly what people paste into support threads, so a wrong figure actively misleads diagnosis.
/etc/php/{version}/fpm/conf.dand the/etc/php{version}/...variant) alongside the Docker one.99-*.inioverrides an earlier10-*.ini), rather than returning the first match found.protectedmethods, so the detection can be tested against fixture directories instead of the real system paths.This is a display-only diagnostic; it changes nothing about how Flarum runs.
Reviewers should focus on:
Necessity
flarum infomisreports the web memory limit on the most common distro layout.php-fpm -ioutput would be heavier and not always available.flarum infois a core command.Confirmed
composer test).Required changes: