Исправить ошибку PHP-FPM при неограниченной памяти (-1)#124
Merged
andchir merged 3 commits intoandchir:mainfrom Dec 27, 2025
Merged
Исправить ошибку PHP-FPM при неограниченной памяти (-1)#124andchir merged 3 commits intoandchir:mainfrom
andchir merged 3 commits intoandchir:mainfrom
Conversation
Adding CLAUDE.md with task information for AI processing. This file will be removed when the task is complete. Issue: andchir#123
Проблема: Когда PHP memory_limit установлен в -1 (неограниченно), numfmt не может обработать это значение, что приводит к отрицательному значению MAX_PHP_PROCESSES и последующей ошибке запуска PHP-FPM. Исправления: - Обработка специального случая memory_limit = -1 (используем 256M) - Валидация результата преобразования (проверка положительного числа) - Использование целочисленной арифметики вместо bc - Гарантия результата в диапазоне 5-50 процессов Fixes andchir#123 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This reverts commit 6418151.
Contributor
Author
🤖 Solution Draft LogThis log file contains the complete execution trace of the AI solution draft process. 💰 Cost estimation:
Now working session is ended, feel free to review and add any feedback on the solution draft. |
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.
Краткое описание
Исправлена ошибка расчёта
pm.max_childrenв PHP-FPM, которая возникала когдаmemory_limitустановлен в-1(неограниченно).Fixes #123
Проблема
При установке WordPress на сервере с PHP, где
memory_limit = -1(неограниченная память), скрипт рассчитывал отрицательное значение дляpm.max_children:Это приводило к ошибке запуска PHP-FPM:
Причина
numfmt --from=iecне может обработать значение-1Решение
memory_limit = -1(используется 256M как разумное значение для WordPress)bcна целочисленную арифметику bash (избегаем зависимости)Тестирование
Добавлен тестовый скрипт
experiments/test_php_memory_limit_parsing.shкоторый проверяет:-1(неограниченно) → 25 процессов (при 6.5 ГБ памяти)128M,256M,512M,1G→ корректный расчёт0, пустое значение, невалидные значения → fallback к 128M🤖 Generated with Claude Code