Feature Request: Check minimum required PHP version before FOG dev-branch upgrades
-
Hello,
I would like to suggest improving PHP version compatibility checks during FOG installation and upgrades, especially when updating to the latest dev-branch.
On several occasions after upgrading FOG development versions, I experienced issues such as:
- The Management Portal login stopped working.
- Newly introduced features produced PHP runtime errors.
- The installer completed successfully without warning that the installed PHP version might not meet the requirements of the updated FOG code.
Not all of these errors were necessarily caused by an outdated PHP version, but better compatibility checks would help prevent and diagnose them.
Suggested improvements:
- Check the installed PHP version before upgrading FOG.
- Define the minimum required PHP version for each FOG release or development build.
- Verify both PHP CLI and PHP-FPM versions.
- Check required PHP extensions and their availability.
- Warn if PHP is too old or if the installed PHP version is not yet supported.
- Perform these checks BEFORE replacing application files or modifying the database.
- Stop the upgrade if a required PHP dependency is missing, unless an explicit override is provided.
- After upgrading, check the Management Portal, login page, HTTP 500 errors and PHP fatal errors.
- Provide a pre-upgrade compatibility check, for example:
./installfog.sh --check-requirements
Example warning:
FOG PHP Compatibility Check
Installed PHP: 8.x
Minimum PHP required: X.Y
Status: Upgrade blocked
Please upgrade PHP before continuing.It would also be useful to display the required PHP version in the installer summary and documentation.
The goal is to prevent situations where FOG reports “Setup complete” but the Management Portal or newly introduced functionality fails afterward.
Could this improvement be considered for a future FOG 1.6 dev-branch update?
Thank you for your continued work on FOG Project!
-
@sgennadi Thanks, this is a good catch. The installer did not check PHP at all. The only check ran on the first web request, after the upgrade was already done.
This is now fixed on dev-branch: https://github.com/FOGProject/fogproject/pull/2154
After the packages install, and before FOG copies any file or touches the database, the installer now:
- stops if the PHP CLI is below FOG’s minimum (PHP 7.4). It reads that number from the FOG code it is installing, so it cannot drift.
- stops if no PHP-FPM of the same version as the CLI is installed. A third-party repository can give you a CLI of 8.5 and an FPM of 8.4, and the web UI runs on FPM.
- warns about a missing PHP extension that FOG uses.
When it stops, your current install is unchanged.
--skip-php-checklets you continue anyway.You get it with your next dev-branch update. The docs are here: https://docs.fogproject.org/1.6/installation/server/command-line-options
If your login breaks again after an update, please post the output of
php -v,php-fpm -v(orphp-fpm8.x -v), and the last lines of the PHP-FPM error log. That tells us whether it is PHP or a bug in the new code. -
@Tom-Elliott
Subject: PHP Compatibility — Minimum Version, Latest Tested Version, and PHP 8.6 FeedbackHi Tom,
Thank you for implementing the PHP pre-installation checks in PR #2154 and addressing the issue discussed in forum topic #18333.
I have one additional suggestion regarding PHP compatibility, especially with newly released PHP versions.
- Our experience with PHP 8.6
We are currently running FOG with PHP 8.6, and so far the main FOG functions appear to be working correctly.
We have not encountered any obvious compatibility problems during normal use.
However, I would not consider this a complete compatibility test, since we have not systematically verified every FOG feature, plugin, and background operation.
- Minimum supported vs. latest tested PHP version
I noticed that FOG currently requires PHP 7.4 or newer.
The new installer checks the minimum version and ensures that matching PHP CLI and PHP-FPM versions are available.
However, there is currently no upper compatibility boundary.
For example, PHP 8.6 passes the minimum-version check even though it may not yet have been fully tested with FOG.
I also checked the current GitHub Actions configuration and noticed that automated PHP tests run on PHP 7.4 and 8.3, while PHPStan currently analyzes the PHP 7.4–8.3 range.
This raises a question:
How can administrators determine which is the latest PHP version officially tested and verified with FOG?
- Suggested improvement: PHP compatibility matrix
Would it be possible to maintain a small PHP compatibility matrix for the current FOG release and development branch?
For example:
PHP Version Compatibility
PHP 7.4 Minimum required
PHP 8.3 Tested in CI
PHP 8.4 Verification needed
PHP 8.5 Verification needed
PHP 8.6 Basic functionality working in our environment; full verification pendingIdeally, the status should be generated from actual automated test results rather than maintained manually.
- Extend GitHub Actions testing
Could the existing CI workflow be extended to test newer PHP versions?
For example:
- PHP 7.4 — minimum compatibility.
- PHP 8.3 — existing test coverage.
- PHP 8.4 — compatibility testing.
- PHP 8.5 — compatibility testing.
- PHP 8.6 — latest stable release testing.
It would also be useful to test PHP-FPM and the extensions required by FOG, not only PHP CLI.
This would help identify compatibility issues early when a new PHP release becomes available.
- Show the latest verified PHP version during installation
Another useful improvement would be for the installer to display:
FOG PHP Compatibility Check
Installed PHP: 8.6.0
Minimum required PHP: 7.4
Latest verified PHP: 8.x
PHP version check: PASSED
Compatibility status: Not yet fully verifiedThe Latest verified PHP value should come from maintained compatibility information backed by successful tests.
If the installed PHP version is newer than the latest verified version, I would suggest displaying a warning rather than blocking the installation.
This would be particularly useful on distributions that ship newer PHP versions before FOG’s CI matrix has been updated.
- Possible future enhancement
Perhaps FOG could maintain a machine-readable compatibility file containing:
- Minimum required PHP version.
- PHP versions covered by automated tests.
- Latest successfully verified PHP version.
- Known incompatibilities or limitations.
- Compatibility information for the current FOG release and dev-branch.
The installer could use this information to provide accurate guidance without requiring administrators to search GitHub issues or forum posts.
- Main goal
My goal is not to introduce an arbitrary maximum PHP version or prevent users from running newer versions.
Instead, I would like FOG to distinguish between:
- Minimum required PHP version.
- Latest PHP version tested successfully.
- Newer PHP versions that may work but have not yet been fully verified.
Since PHP 8.6 is already working for our main FOG operations, it would be useful to include it in the official compatibility testing matrix.
Would you consider adding newer PHP releases to CI and providing administrators with an indication of the latest verified version?
Thank you again for your work on FOG and the recent improvements!
-
@sgennadi Thanks for the PHP 8.6 report.
You are right: CI tested only PHP 7.4 and 8.3. CI now also runs the full test suite on PHP 8.4 and 8.5 for every change. Both pass today. A failure on 8.4 or 8.5 shows as a warning and does not block a change or a release. I will add 8.6 when the CI tooling supports it.
The tested versions are now on the requirements page: https://docs.fogproject.org/installation/server/requirements#php-versions
I will not add a “latest verified PHP” value to the installer. Somebody must update that number by hand at every PHP release, and a stale number warns about versions that work. The docs table changes when the CI matrix changes, so it stays correct.
FOG sets no maximum PHP version. If a newer PHP gives you an error, please post the output of
php -vand the last lines of the PHP-FPM error log.