Hello,
I installed Nextcloud 27 on my server. In the Security & setup warnings
the following warnings appear.
When I check the php-version with php -v on the server. I get the following response
PHP 8.2.8 (cli) (built: Jul 8 2023 07:10:21) (NTS)
Copyright (c) The PHP Group
Zend Engine v4.2.8, Copyright (c) Zend Technologies
with Zend OPcache v8.2.8, Copyright (c), by Zend Technologies
I checked several config and ini files but I can not find the failure.
The server is running under “Ubuntu 22.04.2 LTS (GNU/Linux 5.15.107-2-pve x86_64)” in an Proxmox environment .
Does someone of you have an idea?
Thank you in advance
Ulrich
When you check with php -v in linux command line, it reports PHP version configured for the command line , which can differ from the one that is used by apache/php-fpm used for serving the web content.
The easist to test where your config files point to for the apache/php-fpm config is to create a simple info.php file in your web directory with your Nextcloud installation, the content of the info.php file is the simple one line : <? phpinfo(); ?>
Then go to your browsers, open this info.php file and check the sections for the loaded configuration file / other ini files as per the example screenshot:
Then you need to go and fix your PHP config, so that the apache uses the correct one.
1 Like
ernolf
July 14, 2023, 8:36am
3
If you are using apache2 (you did not provide that information!)
Invoke these commands:
apachectl -tD DUMP_INCLUDES | sed -n '/php.*conf/ s#.*/\([^/]*\)\.conf#\1#p'
dpkg -l | awk '/^ii.*php/ {print $2}'
and:
update-alternatives --get-selections | grep -E "ph(ar|p)"
and if that does not help you, post the echoes here.
Much luck
1 Like
Hello Leo,
thank you for your help. It brought me to the right solution. Some additional information how I solved it.
I create the info.php file as followed:
sudo nano /var/www/html/info.php
The following 3 lines in the file
<?php
phpinfo();
?>
In the web browser I called "ip-address/info.php
Here I got all inforation on the php
I disabled the php8.0 by
sudo a2dismod php8.0
I disabled the php8.2 by
sudo a2dismod php8.2
restarted the apache2
systemctl restart apache2
enabled the php8.2
sudo a2enmod php8.2
restarted the apache2 again
systemctl restart apache2
Done
Thank you again for your support.
Ulrich
2 Likes
Hello ernolf,
thanks for your help.
I could solve the problem in the meantime. (details see below)
Best regards
Ulrich
1 Like
I use nextcloud, pihole and zabbix system on Debian 11 (AMD64), and I had to do this additional step to the above mentioned steps:
sudo a2enconf php8.2-fpm
before I installed it via sudo apt php-fpm
then systemctl restart apache2
This solved the php8.2 change for me.
Ktrls
December 23, 2023, 10:51am
7
Hi ernolf, do you know the same procedure but for Centos with yum?
ernolf
December 23, 2023, 12:08pm
8
yum (which is a link to dnf) is almost the same as apt/apt-get in terms of usage. The options are very similar:
sudo apt(-get) update
corresponds to
sudo yum(/dnf) makecache
apt(-get) upgrade
corresponds to
yum(/dnf) upgrade
apt(-get) install $package(s)
corresponds to
yum(/dnf) install $package(s)
Much luck,
ernolf
Ktrls
December 27, 2023, 9:23am
9
thanks, ernolf, but what about a2dismod and a2enmod ? These are the hard parts for me
ernolf
December 27, 2023, 12:23pm
10
That are tools to enable and disable modules.
They create symlinks from available to used modules.
In Centos (Red hat based OSes) you mostly have to create the symlinks this way:
for a2enmod
(which stand for a pache 2 en able mod ule ) you have to run
sudo ln -s /etc/httpd/modules-available/<modulename>.conf /etc/httpd/conf.modules.d/
and for a2dismod
(which stand for a pache 2 dis able mod ule ) you have to run
sudo rm /etc/httpd/conf.modules.d/<modulename>.conf
Note that <modulename>
should be replaced with the actual name of the Apache module.
It is important to note that this procedure may change depending on the Apache version and the specific configuration on your system. It’s always a good idea to consult the documentation for your specific Apache version and your Linux distribution.
Much luck,
ernolf
system
Closed
September 23, 2024, 1:37pm
11
This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.