nextcloud / nextcloud/server

Try to detect when mismatched SAPI versions (i.e. CLI versus web-side) are in-use

Open
#53,821 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

0. Needs triage enhancement feature: settings
Dominant language
PHP
Stars
36.9k
Forks
5.2k
Avg merge
2d 3h
Merged PRs (30d)
713

Description

In a traditional PHP deployment, the PHP CLI binary version should match the web facing PHP SAPI version. However it's common to have multiple versions of PHP binaries available. This can lead to different versions of PHP being called for CLI modes (i.e. all background jobs + occ).

PHP version mismatches between the CLI SAPI and the web-side SAPI could introduce unexpected behavior differences for code that runs via CLI.

We can probably add a setup check for this.

Implementation idea:

Whenever we're invoked from the CLI, we can check and store a CLI SAPI version fingerprint. Periodically we could do the same on the web-side. Then a setup check can easily retrieve these for comparison.

Contributor guide

Open the contributing guide

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.

Research direction

Start by locating the existing setup-check entry point and the CLI and web-side SAPI entry points. Determine how each context could expose a PHP version fingerprint, then compare them in the setup check. Done means a mismatch is detected and reported while matching versions do not trigger the warning.

Written by the indexing model from the issue text.

Assessment

Tech stack
php
Domain
backend
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.