Upgrade php 7.0 to 7.3

Hi

I’m currently improving my nextcloud installation. I need to upgrade php from 7.0.33-0+deb9u2 to 7.3.

I use this tutorial :

Everything work well, I have the same modules between 7.0 and 7.3 (exepct mcrypt)

But when I disable 7.0 and enable 7.3, and restart, I have this message :

Internal Server Error
The server encountered an internal error and was unable to complete your request.
Please contact the server administrator if this error reappears multiple times, please include the technical details below in your report.
More details can be found in the server log.

Is there a way to check the problem ?

Thank for your help !

I think you have to say nextcloud which php it should use, somewhere in the configuarion.

Hmm, I have the same problem as the OP and do not see a setting which seems relevant. I looked in config.php.

Did you tell the webserver which version of php it should use?

yes with a2enmod and a2dismod. But thats apache and not nextcloud

You do not set the php version in the config.php. Nextcloud uses what Apache “gives it”

Hey guys,

iv’e the same issue after Updating PHP (7.0.33 → 7.3.2-3).
I use nginx together with psql for my nextcloud (V15.0.5).

After the update it’s not possible to get a connection to the datebase.

2019/03/13 22:02:50 [error] 536#536: *164 FastCGI sent in stderr: "PHP message: PHP Fatal error: Uncaught Doctrine\DBAL\DBALException: Failed to connect to the database: An exception occured in driver: could not find driver in /var/www/nextcloud/lib/private/DB/Connection.php:64
Stack trace:
#0 /var/www/nextcloud/3rdparty/doctrine/dbal/lib/Doctrine/DBAL/Connection.php(429): OC\DB\Connection->connect()
#1 /var/www/nextcloud/3rdparty/doctrine/dbal/lib/Doctrine/DBAL/Connection.php(389): Doctrine\DBAL\Connection->getDatabasePlatformVersion()
#2 /var/www/nextcloud/3rdparty/doctrine/dbal/lib/Doctrine/DBAL/Connection.php(328): Doctrine\DBAL\Connection->detectDatabasePlatform()
#3 /var/www/nextcloud/3rdparty/doctrine/dbal/lib/Doctrine/DBAL/Connection.php(623): Doctrine\DBAL\Connection->getDatabasePlatform()
#4 /var/www/nextcloud/lib/private/DB/Connection.php(151): Doctrine\DBAL\Connection->setTransactionIsolation(2)
#5 /var/www/nextcloud/3rdparty/doctrine/dbal/lib/Doctrine/DBAL/DriverManager.php(172): OC\DB\Connection->__construct(Array, Object(Doctrine\DBAL\Driver\PDOPg…PHP message: PHP Fatal error: Uncaught Doctrine\DBAL\DBALException: Failed to connect to the database: An exception occured in driver: could not find driver in /var/www/nextcloud/lib/private/DB/Connection.php:64

I tried to switch back to the old php Version via sudo update-alternatives --config php but it doesn’t help even.

I also changed the php version in my default config like so

upstream php-handler {
#server 127.0.0.1:9000;
#server unix:/var/run/php/php7.0-fpm.sock;
server unix:/var/run/php/php7.3-fpm.sock;
}

Do you have an idea how to fix this issue?
Thanks

Hey,

i could fix my problem.
I just compared the php modules between version 7.3 and 7.0 in /etc/php/7.3/cli/conf.d. and recognized that the module

20-pgsql.ini -> /etc/php/7.3/mods-available/pgsql.ini

was missing.
After installing of pgsql module everthing works fine again.

apt-get install php7.3-pgsql

2 Likes

Hi All,

So here I am with the exact same issue.
Upgraded php7.0 to php7.3
All working fine, but apache still using 7.0
So I ran a2dismod7.0 and a2enmod7.3

Bam. No more Nextcloud ==> Internal Server error

Although phpmyadmin still works, and does register now that it is indeed using php7.3…

HALP ! :slight_smile:

Hello,

pretty sure your missing dependency.

I updated my debian 9 to 10 yesterday, run in some troubles with nc/php …
i was missing a few thing.

so first , here a list of my dependency on my server, check yours and find the missing one/

apt list --installed

This will list all the packages that have been installed using apt. It will also list the packages that were installed as a dependency. Which means that not only you’ll have the applications you installed, you’ll also have a huge list of libraries and other packages that you didn’t install directly.

https://nextcloud.rkn.ovh/index.php/s/07112019_installedPKG (txt file )

in case of missing/error dependencie, use aptitude

1 Like

check of dependencies now pending…
Merci Grenoble !

That sure worked.
After scanning through 1800 lines of packages. I finally ran apt upgrades, and after a last reboot, Nextcloud is back online !
Many thanks

1 Like

yep, you surely hit a hint there.

The strange REBOOT needed in some case when you have broken dependencies …

Normaly, you never-ever reboot a server. Found out when playing with php/apache2 switch/upgrade, sometime a service restart or stop/start is not enought.

1 Like

If done, hit the “closed” status.

Enjoy your php7.3

1 Like

I’m not the one who opened the ticket, so I won’t close it either… for now…
Many thanks for your help and for your time.
Now enjoying php7.3 AND NC16 !
Bonne soirée !

1 Like

Great!

But please note: This is only the solution for those who use Postgresql instead of Mysql (on a Debian based system). In most manuals the installation or update process is described using a setup with Mysql as database. Therefore the installation of the Postgresql driver is often forgotten. If this driver is missing, the installation or update seems to fail!

Hello,
I actually have a very similar issue.
I’m using MySQL and also had database connection problems after upgrade to PHP 7.3 (and Debian 10).
I managed to solve that, but I still have a 500 Internal server error.
Unfortunately no log shows anything about an error (I justed a filewatcher and only access.log gets updated)
So I installed all the PHP modules I could find on different posts, but that didn’t help.

Since there is no log, I feel blind, could someone enlighten me ?

I had the same issue, using mysql. Server error after upgrading to debian 10. solution for me was to manually install all the necessary modules like php-gd, php-zip, php-mbstring. multiple restarts both of the virtual machine and apache2 were necessary, also to get messages about other missing packages.

I solved my issue
I was still using NC15.
So as a last resort I thought, let’s replace the nextcloud folder with the fresh NC16.
Did that and got an erreor that it requires PHP7.2 and that I use PHP7.0 (I thought I was using 7.3)
So I uninstalled php7.0 and libapache2-mod-php7.0, restart apache2 and got to the setup screen.
I took the config/config.php file from the NC15 folder I moved elsewhere, only kept the version number from the new one et voilà