Php module not installed? Yes

Many times I reinstalled NextCloud 12.0.4 on my VPS, because I made some mistakes which I am not able to correct. So rebuilding the VPS is the best way.

Today I did the setup again. The first two commands are:
apt-get -y update && apt-get -y upgrade
apt-get install -y apache2 libapache2-mod-php7.0 php7.0-gd php7.0-json php7.0-mysql php7.0-curl php7.0-mbstring php7.0-intl php7.0-mcrypt php-imagick php7.0-xml php7.0-zip mysql-server php-mysql letsencrypt python-letsencrypt-apache redis-server php-redis

After these commands many other commands come to setup NextCloud. When I visit my domain name in the browser (defined in nextcloud.conf with the tag ServerName), Nextcloud tells me many times
PHP module … not installed
Ask it your network manager
(ok, I do not know the right English terms)

Why do I see this?

Can you please provide more information? What are the exact error messages you’re seeing?

Regards,
Guido

1 Like

I think either the necessary modules were never installed correctly, or Nextcloud is running the wrong version of PHP which doesn’t have the correct modules installed. For example, maybe PHP 5.6 ships with your linux distro with no extra modules, but you installed all PHP 7.0 modules which are not used by PHP 5.6.

Try running in the terminal php -v to see which version is installed. Also php -m | grep -i <module_name> to verify if a module is installed or not.

Reading and reading again the screen:
the last message tells me that I have to reboot the VPS.
That resolves my problem.
Thanks for your help.

Kind regards,
Guido

Aha. I didn’t read that because I only speak English :slightly_smiling_face:

1 Like

Hi,
I know this thread is old now, but I face the same problem you described.

You solved it by rebooting the VPS. Is that just “sudo reboot”?
Nothing works for me, even reinstalling modules or changing the PHP version.
Any help would be appreciated.
Thanks in advance,
regards.

Not sure about sudo reboot, but I use sudo shutdown -r now
What problem exactly are you seeing? Error messages when you visit your Nextcloud instance?

After a fresh installation, at the 1st. run i get:

It basically says:
BBDD drivers are not installed (I don’t know what this is)
Then it mentions several modules not installed, but at the bottom it says "PHP modules are installed, but are listed as missing. Ask your server administrator to reboot the web server.

I just followed instructions from https://linuxhint.com/install_nextcloud_raspberry_pi/ to get here.

I’m trying to install Nextcloud 18.0.1 in a Raspberry Pi 3b using Raspbian february 2020.

I’ve tried updating PHP to 7.4 but nothing else, because it has been difficult to get some using Google.

Have you tried rebooting?

Yes, several times. Using sudo reboot, sudo shutdown -r now.

I get stuck in that screen and can’t finish the installation as expected.

I took every step on installation instructions mentioned above carefully.

Ok. Have you tried installing the modules listed using apt? You would need to specify the PHP version since you upgraded, so something like sudo apt install php7.4-zip php7.4-mbstring and so on.

If so, can you post the output of php -v and php -m

Thanks a lot for your help.
Yes, I’ve tried installing all the modules and just tried again just in case. It says php7.4-zip (for example) is already in its most recent version.

Here’s the output for php -v and php -m:

pi@raspberrypi:~ $ php -v

PHP 7.4.3 (cli) (built: Feb 20 2020 14:15:45) ( NTS )

Copyright © The PHP Group

Zend Engine v3.4.0, Copyright © Zend Technologies

with Zend OPcache v7.4.3, Copyright ©, by Zend Technologies

**pi@raspberrypi:~ $ **

pi@raspberrypi:~ $ php -m

[PHP Modules]

calendar

Core

ctype

curl

date

dom

exif

FFI

fileinfo

filter

ftp

gd

gettext

hash

iconv

json

libxml

mbstring

mysqli

mysqlnd

openssl

pcntl

pcre

PDO

pdo_mysql

Phar

posix

readline

Reflection

session

shmop

SimpleXML

sockets

sodium

SPL

standard

sysvmsg

sysvsem

sysvshm

tokenizer

xml

xmlreader

xmlwriter

xsl

Zend OPcache

zip

zlib

[Zend Modules]

Zend OPcache

If I try to reinstall any module, it says its already in the latest version.
Example:

pi@raspberrypi:~ $ sudo apt install php7.4-zip
Leyendo lista de paquetes… Hecho
**Creando árbol de dependencias **
Leyendo la información de estado… Hecho
php7.4-zip ya está en su versión más reciente (7.4.3-1+0~20200220.11+debian10~1.gbpe23899).
0 actualizados, 0 nuevos se instalarán, 0 para eliminar y 20 no actualizados.

The last line says: “0 updated, 0 new will be installed, 0 to be deleted and 20 not updated”

" php7.4-zip ya está en su versión más reciente" means php7.4-zip is at the latest version.

Another example:

pi@raspberrypi:~ $ sudo apt install php7.4-SimpleXML
Leyendo lista de paquetes… Hecho
**Creando árbol de dependencias **
Leyendo la información de estado… Hecho
Nota, seleccionando «php7.4-simplexml» para el global «php7.4-SimpleXML»
Nota, seleccionando «php7.4-xml» en lugar de «php7.4-simplexml»
php7.4-xml ya está en su versión más reciente (7.4.3-1+0~20200220.11+debian10~1.gbpe23899).
0 actualizados, 0 nuevos se instalarán, 0 para eliminar y 20 no actualizados.

(Same result)

Any other ideas?
Thanks again,

regards.

Next step I would take is to find out which version of PHP Apache is running. It’s possible Apache runs a different version than the cli version you’re using when you run php -v. One kind of hacky method is to temporarily rename the .htaccess file in the web root, then create a file there called phpinfo.php with the following contents, then in the browser go to your nextcloud domain and add /phpinfo.php to the end (for example cloud.yourdomain.com/phpinfo.php):

<?php
  phpinfo();
?>

If you do this, please don’t forget to delete the phpinfo file and also restore .htaccess so you don’t leave your instance open to attacks.
You might just need to disable the old php module and enable the new one for Apache as described here: https://serverfault.com/questions/707383/installed-new-version-of-php-but-apache-still-using-the-old-version

Basically (assuming the old version of PHP you had was 7.3):

sudo a2dismod php7.3
sudo a2enmod php7.4
2 Likes

Do you actually have a reason not to use snap or docker?

It’s actually easier and you won’t get dependencies all over your system.

Agreed, this kind of stuff is not an issue with snap or docker. I would vote for docker since it’s a more valuable skill to know.

It worked like a charm. Thanks a lot!!!
Using the phpinfo.php file you suggested, I found out that Apache was using 7.3.14 version.
Then just did:

sudo a2dismod php7.3
sudo a2enmod php7.4

and it was enough.

You are the best one. Thank you.

@Giuseppe @linucksrox : I don’t know what snap or docker is. But I will search for them and try to learn about it now. Thank you too.

1 Like

Awesome! Glad I could help!