RTC bug PR-5.4-dev Pending

User tests: Successful: Unsuccessful:

avatar Razzo1987
Razzo1987
2 Jan 2026

Summary of Changes

Changed the exit code from 0 (success) to 1 (error) when attempting to install Joomla from CLI without the minimum required PHP version. Currently, the installation script exits with code 0 even when the PHP version check fails, which incorrectly signals success to shell scripts and CI/CD pipelines.

Testing Instructions

Prerequisites:

  • Access to a system with PHP 8.0.x or lower (8.2.x also works for testing in Joomla 6.x)

Steps to test:

  1. Verify your PHP CLI version:

    php -v
  2. Navigate to the Joomla installation directory

  3. Run the CLI installation command:

    php installation/joomla.php
  4. Check the exit code immediately after:

    • Linux/macOS: echo $?
    • Windows (PowerShell): echo $LASTEXITCODE

Actual result BEFORE applying this Pull Request

When running the CLI installation with PHP < 8.1.0:

  • Error message is displayed correctly
  • Exit code is 0 (success)
  • Shell scripts and CI/CD pipelines incorrectly interpret this as successful execution
  • Automation workflows may continue with subsequent steps despite the failure
$ php installation/joomla.php
Sorry, your PHP version is not supported.
Your command line php needs to be version 8.1.0 or newer to run the Joomla! CLI Tools
The version of PHP currently running this code, at the command line, is PHP version 7.x.x.
...

$ echo $?
0  ← WRONG: indicates success

Expected result AFTER applying this Pull Request

When running the CLI installation with PHP < 8.3.0:

  • Error message is displayed correctly (unchanged)
  • Exit code is 1 (error)
  • Shell scripts and CI/CD pipelines correctly identify the failure
  • Automation workflows can properly handle the error condition
$ php installation/joomla.php
Sorry, your PHP version is not supported.
Your command line php needs to be version 8.1.0 or newer to run the Joomla! CLI Tools
The version of PHP currently running this code, at the command line, is PHP version 7.x.x.
...

$ echo $?
1  ← CORRECT: indicates error

Link to documentations

Please select:

  • No documentation changes for docs.joomla.org needed
  • No documentation changes for manual.joomla.org needed

Rationale: This is a bug fix that corrects the exit code behavior to match standard Unix/POSIX conventions. No user-facing functionality or documentation is affected.

avatar Razzo1987 Razzo1987 - open - 2 Jan 2026
avatar Razzo1987 Razzo1987 - change - 2 Jan 2026
Status New Pending
avatar joomla-cms-bot joomla-cms-bot - change - 2 Jan 2026
Category Installation
avatar tecpromotion tecpromotion - change - 2 Jan 2026
Title
Fix CLI installation exit code when PHP version requirement not met
[5.4] Fix CLI installation exit code when PHP version requirement not met
avatar tecpromotion tecpromotion - edited - 2 Jan 2026
avatar alikon alikon - test_item - 3 Jan 2026 - Tested successfully
avatar alikon
alikon - comment - 3 Jan 2026

I have tested this item ✅ successfully on 20be37b


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/46625.

avatar ThomasFinnern ThomasFinnern - test_item - 3 Jan 2026 - Tested successfully
avatar ThomasFinnern
ThomasFinnern - comment - 3 Jan 2026

I have tested this item ✅ successfully on 20be37b

Tested with PHP 8.0.30 (cli) on windows command line
Tested with ECHO %ERRORLEVEL%

Before

  • Errorlevel 0
  • Error message is displayed correctly

After

  • Errorlevel 1
  • Error message is displayed correctly

This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/46625.
avatar richard67 richard67 - change - 3 Jan 2026
Status Pending Ready to Commit
Labels Added: bug PR-5.4-dev
avatar richard67
richard67 - comment - 3 Jan 2026

RTC


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/46625.

avatar muhme muhme - change - 8 Jan 2026
Labels Added: RTC
avatar muhme
muhme - comment - 8 Jan 2026

✅ Final test before merge with JBT (switched with scripts/php 54 php8.0)

  • Seen the exit code 0 before PR
  • Applied PR with gh pr checkout 46625
  • Seen the exit code 1
avatar muhme muhme - change - 8 Jan 2026
Status Ready to Commit Fixed in Code Base
Closed_Date 0000-00-00 00:00:00 2026-01-08 13:41:33
Closed_By muhme
avatar muhme muhme - close - 8 Jan 2026
avatar muhme muhme - merge - 8 Jan 2026
avatar muhme
muhme - comment - 8 Jan 2026

Thank you @Razzo1987 for your contribution. Thank you @wilsonge for review. Thank you @alikon and @ThomasFinnern for testing.

Add a Comment

Login with GitHub to post a comment