Update PHP7.4 failed, now Error 503

Support intro

Sorry to hear you’re facing problems :slightly_frowning_face:

help.nextcloud.com is for home/non-enterprise users. If you’re running a business, paid support can be accessed via portal.nextcloud.com where we can ensure your business keeps running smoothly.

In order to help you as quickly as possible, before clicking Create Topic please provide as much of the below as you can. Feel free to use a pastebin service for logs, otherwise either indent short log examples with four spaces:

example

Or for longer, use three backticks above and below the code snippet:

longer
example
here

Some or all of the below information will be requested if it isn’t supplied; for fastest response please provide as much as you can :heart:

Nextcloud version (eg, 18.0.1): 19.0.1
Operating system and version (eg, Ubuntu 20.04): Ubuntu 18.04
Apache or nginx version (eg, Apache 2.4.25): 2.4.29
PHP version (eg, 7.1): That’s the question

The issue you are facing: Nextcloud is not reachable, Website shows Server Error 503

Is this the first time you’ve seen this error? (Y/N): Y

Steps to replicate it:

  1. Go to the Website

The output of your Nextcloud log in Admin > Logging:

$
{"reqId":"GDvPVUL9q53QO7bRLl6y","level":3,"time":"2020-07-31T14:53:37+02:00","remoteAddr":"xx.xx.xx.xx","user":"--","app":"core","method":"GET","url":"/favicon.ico","message":{"Exception":"Doctrine\\DBAL\\DBALException","M$
{"reqId":"GDvPVUL9q53QO7bRLl6y","level":3,"time":"2020-07-31T14:53:37+02:00","remoteAddr":"xx.xx.xx.xx","user":"--","app":"PHP","method":"GET","url":"/favicon.ico","message":"You are using a fallback implementation of the $
{"reqId":"dU7Ehc4GvWYmwui2JwzM","level":3,"time":"2020-07-31T14:55:02+02:00","remoteAddr":"","user":"--","app":"cron","method":"","url":"--","message":{"Exception":"Doctrine\\DBAL\\DBALException","Message":"Failed to connec$


The output of your config.php file in /path/to/nextcloud (make sure you remove any identifiable information!):

<?php
$CONFIG = array (
  'passwordsalt' => 'xxx',
  'secret' => 'xxx',
  'trusted_domains' =>
  array (
    0 => 'localhost',
    1 => 'xx.xx.xx.xx',
    2 => 'xxx.yy',
    3 => 'xxx.yy',
  ),
  'datadirectory' => '/mnt/ncdata',
  'dbtype' => 'pgsql',
  'version' => '19.0.1.1',
  'overwrite.cli.url' => 'xxx.yy',
  'dbname' => 'nextcloud_db',
  'dbhost' => 'localhost',
  'dbport' => '',
  'dbtableprefix' => 'oc_',
  'dbuser' => 'xx',
  'dbpassword' => 'xxx',
  'installed' => true,
  'instanceid' => 'xxx',
  'upgrade.disable-web' => 'true',
  'log_type' => 'file',
  'logfile' => '/var/log/nextcloud/nextcloud.log',
  'loglevel' => '2',
  'mail_smtpmode' => 'smtp',
  'remember_login_cookie_lifetime' => '1800',
  'log_rotate_size' => '10485760',
  'trashbin_retention_obligation' => 'auto, 180',
  'versions_retention_obligation' => 'auto, 365',
  'simpleSignUpLink.shown' => 'false',
  'memcache.local' => '\\OC\\Memcache\\APCu',
  'filelocking.enabled' => true,
  'memcache.distributed' => '\\OC\\Memcache\\Redis',
  'memcache.locking' => '\\OC\\Memcache\\Redis',
  'redis' =>
  array (
    'host' => '/var/run/redis/redis-server.sock',
    'port' => 0,
    'timeout' => 0.5,
    'dbindex' => 0,
    'password' => 'xxx',
  ),
 'logtimezone' => 'Europe/Berlin',
  'htaccess.RewriteBase' => '/',
  'share_folder' => '/Shared',
  'enable_previews' => true,
  'enabledPreviewProviders' =>
  array (
    11 => 'OC\\Preview\\PNG',
    12 => 'OC\\Preview\\JPEG',
    14 => 'OC\\Preview\\BMP',
    18 => 'OC\\Preview\\Movie',
  ),
  'preview_max_x' => '2048',
  'preview_max_y' => '2048',
  'jpeg_quality' => '60',
  'maintenance' => false,

  'mail_sendmailmode' => 'smtp',
  'mail_smtpsecure' => 'ssl',
  'mail_domain' => 'xxx',
  'mail_from_address' => 'xxx',
  'mail_smtpauthtype' => 'LOGIN',
  'mail_smtpauth' => 1,
  'mail_smtphost' => 'xxx',
  'mail_smtpname' => 'xxx',
  'mail_smtppassword' => 'xxx',
  'mail_smtpport' => '465',
);




The output of your Apache/nginx/system log in /var/log/____:


[Fri Jul 31 14:21:12.406025 2020] [mpm_prefork:notice] [pid 4588] AH00169: caught SIGTERM, shutting down
[Fri Jul 31 14:21:12.553415 2020] [mpm_event:notice] [pid 4749:tid 140154447203264] AH00489: Apache/2.4.29 (Ubuntu) mod_fcgid/2.3.9 OpenSSL/1.1.1g configured -- resuming normal operations
[Fri Jul 31 14:21:12.553590 2020] [core:notice] [pid 4749:tid 140154447203264] AH00094: Command line: '/usr/sbin/apache2'
[Fri Jul 31 14:37:24.943460 2020] [mpm_event:notice] [pid 4749:tid 140154447203264] AH00491: caught SIGTERM, shutting down
[Fri Jul 31 14:37:25.102876 2020] [mpm_event:notice] [pid 10786:tid 140556418128832] AH00489: Apache/2.4.29 (Ubuntu) mod_fcgid/2.3.9 OpenSSL/1.1.1g configured -- resuming normal operations
[Fri Jul 31 14:37:25.103016 2020] [core:notice] [pid 10786:tid 140556418128832] AH00094: Command line: '/usr/sbin/apache2'
[Fri Jul 31 14:38:10.624256 2020] [mpm_event:notice] [pid 10786:tid 140556418128832] AH00491: caught SIGTERM, shutting down
[Fri Jul 31 14:38:10.791443 2020] [mpm_event:notice] [pid 11389:tid 140354841398208] AH00489: Apache/2.4.29 (Ubuntu) mod_fcgid/2.3.9 OpenSSL/1.1.1g configured -- resuming normal operations
[Fri Jul 31 14:38:10.791578 2020] [core:notice] [pid 11389:tid 140354841398208] AH00094: Command line: '/usr/sbin/apache2'

Hi,

I tried to Update my PHP Version to 7.4. This worked and php -v showed

PHP 7.4.8 (cli) (built: Jul 13 2020 16:45:47) ( NTS )
Copyright (c) The PHP Group
Zend Engine v3.4.0, Copyright (c) Zend Technologies
    with Zend OPcache v7.4.8, Copyright (c), by Zend Technologies

But the Nextcloud Web Admin still see the Message, that PHP7.2 is installed and should be updated soon. So I deleted every PHP Version but 7.4, and as a result nothing is working now. When I go to the Website the Error 503 appears.
So I tried to uninstall PHP7.4 and install 7.2, but this did not work.
php -v still shows PHP7.4.

I guess I have a mixture of different PHP Versions which are causing this conflict.

Can someone please tell me howto reinstall/install a clear PHP that is working? Or is this a different Error?

If you need additional information feel free to ask.

Did you update Apache configs to use php7.4-fpm.sock? I’m not familiar to Apache cuz using Nginx.
You are also should proceed a part of installation proccess related to php connection.

Nginx’s connection to php https://docs.nextcloud.com/server/17/admin_manual/installation/nginx.html?highlight=fpm%20sock

Configuring of PHP https://docs.nextcloud.com/server/17/admin_manual/installation/source_installation.html#php-ini-configuration-notes

Welcome to the Nextcloud community @LMD
I had the same issue run
a2enmod php7.4 && systemctl reload apache2
This is the thread I opened about this

Hi,

I installed php7.4 again with all the recommended modules.

Then I run
´´´
a2enmod php7.4 && systemctl reload apache2
´´´
but there is still the 503 Error. What else should I check?

have you searched the forum for that problem. there are several possible solutions online.

pls do always search for already existing solutions first and then make a posting.

Yeah, I searched for it but I didn’t found anything.

Okay, new Information: I disabled everything and enabled 7.4.

sudo a2dismod php7.2
Module php7.2 already disabled
sudo a2dismod php7.3
ERROR: Module php7.3 does not exist!
sudo a2dismod php7.0
ERROR: Module php7.0 does not exist!
sudo a2dismod php7.1
ERROR: Module php7.1 does not exist!
sudo a2enmod php7.4
Considering dependency mpm_prefork for php7.4:
Considering conflict mpm_event for mpm_prefork:
Considering conflict mpm_worker for mpm_prefork:
Module mpm_prefork already enabled
Considering conflict php5 for php7.4:
Module php7.4 already enabled

So the 503 Error disappear, but it is still not working. Now it just says:

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.

Nextcloud Log:

{"reqId":"2rwzNuJr8i4sHJQYzLU2","level":3,"time":"2020-07-31T19:53:25+02:00","remoteAddr":"xx.xx.xx.xx","user":"--","app":"PHP","method":"GET","url":"/index.php/204","message":"You are using a fallback implementation of the e intl extension. Installing the native one is highly recommended instead. $

So I installed intl, but the log did not change:

sudo apt-get install php7.4-intl
Reading package lists... Done
Building dependency tree
Reading state information... Done
php7.4-intl is already the newest version (7.4.8-1+ubuntu18.04.1+deb.sury.org+3).