fix: stop all old PHP-FPM services before upgrade and remove unreachable branch in php-update.sh - #228
Merged
Conversation
… php-update.sh Agent-Logs-Url: https://github.com/EngineScript/EngineScript/sessions/3539d3a2-a5e6-4abe-87ac-aaf4c0fe3c00 Co-authored-by: PDowney <11467177+PDowney@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Fix stopping only first detected old PHP version during upgrades
fix: stop all old PHP-FPM services before upgrade and remove unreachable branch in php-update.sh
May 2, 2026
Removed outdated entry for PHP update on 2026-05-02, including fixes for service stop and dead code removal.
Dependency Review✅ No vulnerabilities or license issues or OpenSSF Scorecard issues found.Scanned FilesNone |
PDowney
approved these changes
May 2, 2026
|
Contributor
There was a problem hiding this comment.
Pull request overview
Fixes scripts/update/php-update.sh to better handle multi-version PHP upgrades and removes dead summary logic, improving reliability of PHP-FPM upgrades in EngineScript.
Changes:
- Stop all detected old
phpX.Y-fpmservices (not just the first) before installing the new PHP version. - Remove an unreachable
elsebranch in the final “Changes made” summary output.
Comment on lines
+77
to
+80
| for old_ver in "${MIGRATION_SOURCE_PHP_VERS[@]}"; do | ||
| echo "Stopping PHP ${old_ver} service..." | ||
| systemctl stop "php${old_ver}-fpm" 2>/dev/null || true | ||
| done |
Comment on lines
+76
to
+80
| # Stop old PHP service(s) | ||
| for old_ver in "${MIGRATION_SOURCE_PHP_VERS[@]}"; do | ||
| echo "Stopping PHP ${old_ver} service..." | ||
| systemctl stop "php${old_ver}-fpm" 2>/dev/null || true | ||
| done |
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.



Two bugs in
scripts/update/php-update.sh: only the first detected old PHP-FPM service was stopped before the upgrade, and the final summary contained a deadelsebranch that could never be reached.Software Version Updates
Changed Versions
scripts/update/php-update.sh— bug fixes only, no version changesVersion Diff
Verification Checklist
Notes
Fix 1 — Multi-version service stop: The pre-upgrade stop only called
systemctl stoponOLD_PHP_VER(the first element). When multiple old PHP versions are installed, the remaining services stayed running during the upgrade. Now iteratesMIGRATION_SOURCE_PHP_VERS[@], consistent with the existing cleanup loop at lines 194–216.Fix 2 — Dead code removal: The
if [[ ${#MIGRATION_SOURCE_PHP_VERS[@]} -gt 0 ]]guard in the final summary is always true — the script exits at lines 49–58 when no old versions are detected, making theelsebranch permanently unreachable. Replaced with the unconditional echo.Original prompt