NextcloudPi shows wrong PHP version

Support intro

Before clicking submit: Please check if your query is already addressed via the following resources:

The Basics

  • Nextcloud Server version (e.g., 29.x.x):
    • 34.0.1
  • Operating system and version (e.g., Ubuntu 24.04):
    • Linux 6.6.63-current-bcm2712 aarch64
  • Web server and version (e.g, Apache 2.4.25):
    • replace me
  • Reverse proxy and version _(e.g. nginx 1.27.2)
    • replace me
  • PHP version (e.g, 8.3):
    • 8.3.31
  • Is this the first time you’ve seen this error? (Yes / No):
    • No
  • When did this problem seem to first start?
    • After installation of NCP 1.54.0
  • Installation method (e.g. AlO, NCP, Bare Metal/Archive, etc.)
    • NCP
  • Are you using CloudfIare, mod_security, or similar? (Yes / No)
    • No

Summary of the issue you are facing:

ncp-dist-upgrade is available but cannot be executed as ncp reports the PHP still to be 8.1 although only 8.3.31 is installed

Steps to replicate it (hint: details matter!):

  1. Log on to ncp via ssh

  2. perform sudo ncp-dist-upgrade

Log entries

Nextcloud

Please provide the log entries from your Nextcloud log that are generated during the time of problem (via the Copy raw option from Administration settings->Logging screen or from your

This is what I’d like to know …

Early last year I tried to install ncp on a Pi5 (then latest version: 1.55.0). However the system got stuck while booting in a PHP loop (PHP 8.3). I then installed 1.54.0 (PHP 8.1) which worked fine. I could successfully setup my instance.

I updated ncp to 1.55.0 - but obviously PHP 8.1 did not update to PHP 8.3 as it was supposed to. I then installed PHP 8.3 manually executing php-updater script and removed all remains of PHP 8.1:

I am aware that I made manual changes to the configuration when I executed php-updater and I understand that this can cause problems. My understanding of the issue is that somewhere - maybe in a config file - the previous PHP version 8.1 is still prevalent. My question is simple: Can this be fixed or would you recommend a reinstallation of ncp?

As my instance has been running smoothely all the time (correctly displaying PHP 8.3.31 by the way) I pretty much ignored the issue but now, in the light of the pending dist-upgrade, I’d like to have it fixed one way or the other.

Yes, probably, but may be not by “us”.
The update to ncp 1.58 went without errors?
The error messages running sudo ncp-dist-upgrade maybe helpful.

Hi @piemaker,

That sounds a little strange. :sweat_smile:

Have you also switched the system interpreter to the new PHP version?
sudo update-alternatives --config php
→ Select PHP version 8.3

Have you also enabled the new PHP version on the web server?

sudo a2dismod php8.1-version
sudo a2enmod php8.3-version

These two commands disable the old PHP version in the Apache web server and enable the new PHP version.
This allows Apache to determine which PHP version is actually used when web pages are loaded.

Best regards!

Hi @Forest.328 ,

thanks for reaching out.

I already executed update-alternatives --config php:

I selected 0 for auto mode

The other two commands generate this output:

grafik

Hi @geoW

Yes, all further ncp updates worked fine.

This is what I get when I run ncp-dist-upgrade:

grafik

The webserver displays the latest php version:

Hi @piemaker,

for testing please select the manual mode and try it again. :slight_smile:

tbh, I just try setting up a rpi5 test server, I never succeed in doing a proper dist-upgrade on rpi5, rpi4 went well.

Same result …

What I also had done before I opened this issue here was:

All commands worked fine (using PHP8.3 respectively) but neither of them made any difference. The upper ones were surely useless as I had removed all vestiges of PHP8.1 before. The lines for setting up Apache for PHP8.3 looked promising but had no effect.