Upgrade PHP from 7.2 to 7.3 causes database trouble

Configuration as below; using PHP 7.2 which was recommended months ago when I first setup.

Now I see 7.3 is recommended.

I installed PHP 7.3; disabled 7.2 and enabled 7.3.

Onwcloud then failed. Web access page showed error about not being able to connect to database.

I spent ages searching but not much help. One hint was to use database type mysqli instead of mysql.

Tried that and errors reduced but ended with “wrong database type”.

Does anyone else have this issue?

Edit: I remember when installing PHP 7.2 there was a list of extra modules to install as well. I haven’t seen an equivalent list for 7.3. Is that what I’m missing? Where to find dependency lists?

I see there is mention of 7.3 not supporting mySql - what are we supposed to do?

Server configuration

Operating system:Ubuntu 18.04

Web server: Apache/2.4.29 (Ubuntu)

Database: mySQL Ver 15.1 Distrib 10.1.43-MariaDB, for debian-linux-gnu (x86_64) using readline 5.2

PHP version: 7.2.24

ownCloud version:

Storage backend (external storage): SMB attached drive

Link to similar issues (seen by nextcloud users)

Sorry - it was just a case of some missing PHP extensions.
All seems well now.
This is the list I used…
sudo apt install php7.3-common php7.3-mysql php7.3-xml php7.3-xmlrpc php7.3-curl php7.3-gd php7.3-imagick php7.3-cli php7.3-dev php7.3-imap php7.3-mbstring php7.3-opcache php7.3-soap php7.3-zip php7.3-intl -y

Here is a quick oneliner to install the same PHP modules in another version:

dpkg -l | grep php<installed version> | cut -c 5- | cut -f 1 -d " " | sed "s/<installed version>/<new version>/g" | xargs echo apt-get install

So you can run it for example like so:

root@ubuntu1804: dpkg -l | grep php7.2 | cut -c 5- | cut -f 1 -d " " | sed "s/7.2/7.3/g" | xargs echo apt-get install
apt-get install libapache2-mod-php7.3 php7.3 php7.3-cli php7.3-common php7.3-curl php7.3-gd php7.3-imap php7.3-intl php7.3-json php7.3-ldap php7.3-mbstring php7.3-mysql php7.3-opcache php7.3-readline php7.3-xml php7.3-zip

Then you can double check the output and run it as root (or with sudo).

1 Like


or simply I’d suggest reading the official documentation to be sure :wink:
You have the full PHP extension list.

Yes, thanks for the tips. There is rather a lot of documentation so not always easy to find what you need.

Another question then…
On the link you provided it tells me…
" You can check the presence of a module by typing php -m | grep -i <module_name>"
Also I can type “sudo apt list --installed” to see which extensions are installed.

No “apt” tell me …
php7.3-curl/bionic,now 7.3.14-6+ubuntu18.04.1+deb.sury.org+1 amd64 [installed]

But “php -m” shows a long list and “Curl” is not there at all…

Maybe there is a difference between “module” and “extension”

But “json” is in both lists which it confusing.

What is the point of listing out modules with php -m if we are checking for extensions?

What is the relationship/mapping between them?


actually I think you can consider modules and extensions as the same even though it seems technically they’re not exactly the same. What makes me say they’re similar is the fact that the PHP manual is talking about extensions but the cli about modules:

  -m               Show compiled in modules

Anyway, I’ve noticed you stated joson instead of json, are you sure your check is thorough for curl ? Could it be a small typing mistake ? So you have several PHP versions installed ?