Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

[2.x] False CLI/Web PHP mismatch when /usr/bin/php differs from the site's FPM

Open Beginner friendly
#5,237 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
78/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Active
Tech stack
nginx, php
Domain
cli, devops

Research direction

Start with InfoCommand::detectWebServerPhpVersion() in src/Foundation/Console/InfoCommand.php and trace how the command selects the CLI and web PHP versions. Reproduce the mismatch by running the command with the site's FPM PHP and a different /usr/bin/php, then update the detection behavior so it reports the actual web runtime or an inability to detect it. Verify the output no longer labels an unrelated CLI executable as the Web PHP version.

Written by the indexing model from the issue text.

Description

type/bug
Current Behavior

Separating this issue from #5231 .
This issue was located by developers, analyzed by me and an agent.

Anything below this point was written by AI

InfoCommand::detectWebServerPhpVersion() falls back to /usr/local/bin/php and /usr/bin/php without verifying that they belong to the site's web runtime. The installed file matches the upstream commit byte for byte.

Impact: misleading deployment diagnostics; no observed forum functionality failure.

Steps to Reproduce
  1. Configure the forum's Nginx entry point to use PHP-FPM 8.3.31. Leave /usr/bin/php pointing to PHP CLI 8.2.31.
  2. Run the info command with PHP 8.3.31 explicitly: /path/to/php83 flarum info.
  3. The output is:
PHP version: CLI: 8.3.31, Web: 8.2.31 (MISMATCH - versions should match!)

Both the command and the forum's actual FPM runtime use 8.3.31. The reported Web version comes from an unrelated CLI binary.

Expected Behavior

Expected: report the site's actual web PHP version, or unable to detect when it cannot be determined reliably. An unrelated CLI executable should not be reported as Web PHP.

Screenshots

No response

Environment
  • Flarum version: 2.0.1
  • Website URL: https://forum.monika.love (already patched on my instance)
  • Webserver: nginx
  • Hosting environment: local server
  • PHP version: 8.3.31
  • Database: MySQL 8.4.11
  • Browser: chrome any
Output of php flarum info
Flarum core: 2.0.1
PHP version: CLI: 8.3.31, Web: 8.2.31 (MISMATCH - versions should match!)
PHP memory limit: CLI: 1024M, Web: unable to detect
MySQL version: 8.4.11
Loaded extensions: Core, date, libxml, openssl, pcre, sqlite3, zlib, bcmath, ctype, curl, dom, filter, ftp, gd, gettext, hash, iconv, intl, json, mbstring, SPL, session, pcntl, standard, mysqlnd, PDO, pdo_mysql, pdo_sqlite, Phar, posix, random, Reflection, mysqli, shmop, SimpleXML, soap, sockets, sodium, sysvsem, tokenizer, xml, xmlreader, xmlwriter, cgi-fcgi, zip, fileinfo, exif, gmp, Zend OPcache
+----------------------------------------+--------------------+--------+-------+
| Flarum Extensions                      |                    |        |       |
+----------------------------------------+--------------------+--------+-------+
| ID                                     | Version            | Commit | Notes |
+----------------------------------------+--------------------+--------+-------+
| flarum-realtime                        | v2.0.1             |        |       |
| flarum-audit                           | v2.0.1             |        |       |
| flarum-deck                            | v2.0.1             |        |       |
| flarum-suspend                         | v2.0.1             |        |       |
| flarum-flags                           | v2.0.1             |        |       |
| flarum-tags                            | v2.0.1             |        |       |
| fof-user-directory                     | 2.0.1              |        |       |
| fof-pages                              | 2.0.0-beta.2       |        |       |
| flarum-approval                        | v2.0.1             |        |       |
| askvortsov-auto-moderator              | 0.1.3+copy2        |        |       |
| flarum-likes                           | v2.0.1             |        |       |
| flarum-sticky                          | v2.0.1             |        |       |
| fof-merge-discussions                  | 2.0.0-beta.4       |        |       |
| fof-forum-widgets-core                 | 2.0.2              |        |       |
| flarum-nicknames                       | v2.0.1             |        |       |
| fof-best-answer                        | 2.0.0              |        |       |
| fof-upload                             | 2.0.1+site21.3     |        |       |
| fof-sitemap                            | 3.0.0-beta.6       |        |       |
| flarum-markdown                        | v2.0.1             |        |       |
| flamarkt-backoffice                    | 0.1.3+copy2        |        |       |
| flarum-mentions                        | v2.0.1             |        |       |
| flarum-subscriptions                   | v2.0.1             |        |       |
| antoinefr-money                        | v2.0.0-rc.1        |        |       |
| zequeen-acgembed-remastered            | 1.1.2+copy2        |        |       |
| v17development-user-badges             | 1.1.0+copy2        |        |       |
| the-turk-stickiest                     | 3.0.1+copy2        |        |       |
| pipecraft-id-slug                      | 1.1.0+copy2        |        |       |
| nyu8-email-filter                      | 1.0.7+copy2        |        |       |
| nearata-embed-video                    | 3.3.2+copy2        |        |       |
| michaelbelgium-discussion-views        | 8.0.0+copy2        |        |       |
| justoverclock-staff-members-widget     | 0.1.3+copy2        |        |       |
| justoverclock-guestengagement          | 1.0.3+copy2        |        |       |
| imeepo-daily-check-in                  | 1.1.0+copy2        |        |       |
| ianm-syndication                       | 2.0.0-beta.1       |        |       |
| ianm-html-head                         | 2.0.0              |        |       |
| forumaker-profile-cover                | 2.8.0              |        |       |
| fof-username-request                   | 2.0.0              |        |       |
| fof-user-bio                           | 2.0.0              |        |       |
| fof-terms                              | 2.0.0              |        |       |
| fof-synopsis                           | 2.0.0-rc.2+copy2   |        |       |
| fof-split                              | 2.0.0-beta.4       |        |       |
| fof-seo                                | 4.0.0-beta.14      |        |       |
| fof-rich-text                          | 2.0.0-beta.6+copy2 |        |       |
| fof-pwa                                | 2.0.0+site21.3     |        |       |
| fof-profile-image-crop                 | 2.0.0-rc.1         |        |       |
| fof-prevent-necrobumping               | 2.0.0-beta.1       |        |       |
| fof-polls                              | 3.0.0+site21.3     |        |       |
| fof-online-users-widget                | 2.0.0              |        |       |
| fof-news-widget                        | 2.0.0              |        |       |
| fof-moderator-warnings                 | 2.0.0-rc.3+copy2   |        |       |
| fof-links                              | 2.0.0-rc.3         |        |       |
| fof-linguist                           | 2.0.0-beta.1       |        |       |
| fof-impersonate                        | 2.0.0-beta.4       |        |       |
| fof-html-errors                        | 2.0.0-beta.1       |        |       |
| fof-forum-stats-widget                 | 2.0.0-beta.2       |        |       |
| fof-formatting                         | 2.0.0-beta.2       |        |       |
| fof-follow-tags                        | 2.0.0-beta.7       |        |       |
| fof-drafts                             | 2.0.0+site21.3     |        |       |
| fof-doorman                            | 3.0.0              |        |       |
| fof-direct-links                       | 2.0.0-beta.1       |        |       |
| fof-ban-ips                            | 2.0.0-beta.2       |        |       |
| fof-anti-spam                          | 2.0.0-rc.6         |        |       |
| flarum-statistics                      | v2.0.1             |        |       |
| flarum-lock                            | v2.0.1             |        |       |
| flarum-lang-english                    | v2.0.0             |        |       |
| flarum-lang-chinese-simplified         | 2.0.0+site21.3     |        |       |
| flarum-emoji                           | v2.0.1             |        |       |
| flarum-bbcode                          | v2.0.1             |        |       |
| ekumanov-post-search                   | 1.1.0+site21       |        |       |
| ekumanov-inline-audio                  | 2.10.4+site21.3    |        |       |
| edgeinfinity-dcc-customizations        | 1.0.0+copy2        |        |       |
| edgeinfinity-auto-lang                 | 1.0.0+copy2        |        |       |
| ecnu-im-sticky-sidenav                 | 1.1.0+copy2        |        |       |
| club-1-cross-references                | 1.1.1+copy2        |        |       |
| club-1-chore-commands                  | 1.0.0+copy2        |        |       |
| clarkwinkelmann-prominent-post-numbers | 2.0.0+site21.3     |        |       |
| clarkwinkelmann-money-rewards          | 1.0.0+copy2        |        |       |
| blomstra-sort-order-toggle             | 0.2.0+copy2        |        |       |
| blomstra-search                        | 2.0.0-rc.8+copy2   |        |       |
| askvortsov-markdown-tables             | 1.2.1+copy2        |        |       |
| acpl-mobile-tab                        | 2.0.1              |        |       |
+----------------------------------------+--------------------+--------+-------+
Base URL: https://forum.monika.love
Installation path: /www/wwwroot/192.168.5.132/public
Queue driver: redis
Session driver: redis (Code override. Configured to file)
Scheduler status: 运行中
Mail driver: smtp
Debug mode: off

Possible Solution

No response

Additional Context

No response

Dominant language
PHP
Stars
6.8k
Forks
887
Avg merge
12h 6m
Merged PRs (30d)
127

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from flarum/framework

All issues in flarum/framework

Similar issues

More PHP issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.