Owncloud no longer starts after system update

Good evening,
after updating the system (raspberry pi os) I can no longer access owncloud via the web…
from shel I tried to issue the following commands:

Blockquotepi@raspberrypi:~ $ cd /var/www/owncloud/pi@raspberrypi:/var/www/owncloud $ sudo -u www-data php occ maintenance:mode -off
This version of ownCloud is not compatible with PHP 8.0
You are currently running PHP 8.2.12.

Blockquote

the error is in the php version (I have installed
or 7)…
could you tell me how to solve it?

You need to install PHP 7.4.

I had foreseenly installed php 7.4, in fact now trying to install it:

Blockquote
pi@raspberrypi:~ $ sudo apt-get install php7.4 libapache2-mod-php7.4 php7.4-cli php7.4-fpm php7.4-common php7.4-mbstring php7.4-gd php7.4-intl php7.4-xml php7.4-mysql php7.4-zip php7.4-curl php7.4-ldap php7.4-bz2 php-ssh2 php-apcu php-smbclient php-imagick libmagickcore-dev -y
Lettura elenco dei pacchetti… Fatto
Generazione albero delle dipendenze… Fatto
Lettura informazioni sullo stato… Fatto
libmagickcore-dev è già alla versione più recente (8:6.9.11.60+dfsg-1.3+deb11u1).
libapache2-mod-php7.4 è già alla versione più recente (1:7.4.33-8+0~20230904.88+debian11~1.gbp87c414).
php-apcu è già alla versione più recente (5.1.22+±1+0~20230618.37+debian11~1.gbp7134d4).
php-imagick è già alla versione più recente (3.7.0-4+0~20230701.41+debian11~1.gbpbf7e27).
php-smbclient è già alla versione più recente (1.1.1-1+0~20230612.24+debian11~1.gbp8be856).
php-ssh2 è già alla versione più recente (1.4-1+0~20230612.27+debian11~1.gbpbf65fb).
php7.4 è già alla versione più recente (1:7.4.33-8+0~20230904.88+debian11~1.gbp87c414).
php7.4-bz2 è già alla versione più recente (1:7.4.33-8+0~20230904.88+debian11~1.gbp87c414).
php7.4-cli è già alla versione più recente (1:7.4.33-8+0~20230904.88+debian11~1.gbp87c414).
php7.4-common è già alla versione più recente (1:7.4.33-8+0~20230904.88+debian11~1.gbp87c414).
php7.4-curl è già alla versione più recente (1:7.4.33-8+0~20230904.88+debian11~1.gbp87c414).
php7.4-fpm è già alla versione più recente (1:7.4.33-8+0~20230904.88+debian11~1.gbp87c414).
php7.4-gd è già alla versione più recente (1:7.4.33-8+0~20230904.88+debian11~1.gbp87c414).
php7.4-intl è già alla versione più recente (1:7.4.33-8+0~20230904.88+debian11~1.gbp87c414).
php7.4-ldap è già alla versione più recente (1:7.4.33-8+0~20230904.88+debian11~1.gbp87c414).
php7.4-mbstring è già alla versione più recente (1:7.4.33-8+0~20230904.88+debian11~1.gbp87c414).
php7.4-mysql è già alla versione più recente (1:7.4.33-8+0~20230904.88+debian11~1.gbp87c414).
php7.4-xml è già alla versione più recente (1:7.4.33-8+0~20230904.88+debian11~1.gbp87c414).
php7.4-zip è già alla versione più recente (1:7.4.33-8+0~20230904.88+debian11~1.gbp87c414).
0 aggiornati, 0 installati, 0 da rimuovere e 0 non aggiornati.

typing php -v tells me I’m using 8.0

Yes, for the shell. But the Apache should use 7.4

You can set the default PHP CLI version using update-alternatives or you can explicitly call php7.4 in your commands. You could also simply uninstall other PHP versions if you don’t need them.

with apr purge php8.* I managed to uninstall php 8, now typing php -v tells me that version 7.4.33 is in use, calling the owncloud IP address still doesn’t open the login screen…
I also gave this command:
pi@raspberrypi:/var/www/owncloud $ sudo -u www-data php occ maintenance:mode --off
Maintenance mode disabled
Nothing

You normally would log in using a hostname, not an IP address. You will likely need to review your Apache configs and logs to find the issue.

It may be your Apache web server is still using the PHP 8.2 version. You can double-check this by creating a phpinfo.php file under your Document Root and calling it over browser.

If this is the case, you may need to run the a2dismod and a2enmod commands in order for Apache to use correct PHP version.

1 Like

It doesn’t even let me open phpinfo.php, I still tried to issue the commands you posted, here’s the result:

Blockquote
pi@raspberrypi:~ $ a2dismod
Your choices are: access_compat alias auth_basic authn_core authn_file authz_core authz_host authz_user autoindex deflate dir env filter headers mime mpm_prefork negotiation php7.4 reqtimeout rewrite setenvif socache_shmcb ssl status
Which module(s) do you want to disable (wildcards ok)?

pi@raspberrypi:~ $ a2enmodYour choices are: access_compat actions alias allowmethods asis auth_basic auth_digest auth_form authn_anon authn_core authn_dbd authn_dbm authn_file authn_socache authnz_fcgi authnz_ldap authz_core authz_dbd authz_dbm authz_groupfile authz_host authz_owner authz_user autoindex brotli buffer cache cache_disk cache_socache cern_meta cgi cgid charset_lite data dav dav_fs dav_lock dbd deflate dialup dir dump_io echo env expires ext_filter file_cache filter headers heartbeat heartmonitor http2 ident imagemap include info lbmethod_bybusyness lbmethod_byrequests lbmethod_bytraffic lbmethod_heartbeat ldap log_debug log_forensic lua macro md mime mime_magic mpm_event mpm_prefork mpm_worker negotiation php7.4 proxy proxy_ajp proxy_balancer proxy_connect proxy_express proxy_fcgi proxy_fdpass proxy_ftp proxy_hcheck proxy_html proxy_http proxy_http2 proxy_scgi proxy_uwsgi proxy_wstunnel ratelimit reflector remoteip reqtimeout request rewrite sed session session_cookie session_crypto session_dbd setenvif slotmem_plain slotmem_shm socache_dbm socache_memcache socache_redis socache_shmcb speling ssl status substitute suexec unique_id userdir usertrack vhost_alias xml2enc
Which module(s) do you want to enable (wildcards ok)?

pi@raspberrypi:~ $

What do you get, if you run this:

ls /etc/apache2/mods-enabled/ | grep php

pi@raspberrypi:~ $ ls /etc/apache2/mods-enabled/ | grep php
php7.4.conf
php7.4.load

But then it’s OK, Apache is running PHP 7.4. Where’s the problem now?

typing the owncloud IP address doesn’t open the login page, nothing

Verify your Apache site configuration. Please consult the ownCloud docs.

following the guide: Configure Apache for Manual Installation on Linux

Blockquote
pi@raspberrypi:~ $ a2enmod rewrite
Module rewrite already enabled
pi@raspberrypi:~ $ sudo a2enmod headers
Module headers already enabled
pi@raspberrypi:~ $ sudo a2enmod env
Module env already enabled
pi@raspberrypi:~ $ sudo a2enmod dir
Module dir already enabled
pi@raspberrypi:~ $ sudo a2enmod mime
Module mime already enabled
pi@raspberrypi:~ $ sudo a2enmod unique_idsudoERROR: Module unique_idsudo does not exist!
pi@raspberrypi:~ $ sudo service apache2 restart
Job for apache2.service failed because the control process exited with error code.
See “systemctl status apache2.service” and “journalctl -xe” for details.
pi@raspberrypi:~ $ sudo a2enmod ssl
Considering dependency setenvif for ssl:
Module setenvif already enabled
Considering dependency mime for ssl:
Module mime already enabled
Considering dependency socache_shmcb for ssl:
Module socache_shmcb already enabled
Module ssl already enabled
pi@raspberrypi:~ $ sudo a2ensite default-ssl
Site default-ssl already enabled
pi@raspberrypi:~ $ sudo service apache2 reload
pi@raspberrypi:~ $ sudo a2dismod mpm_event
Module mpm_event already disabled
pi@raspberrypi:~ $ sudo systemctl restart apache2
Job for apache2.service failed because the control process exited with error code.
See “systemctl status apache2.service” and “journalctl -xe” for details.
pi@raspberrypi:~ $ sudo a2enmod mpm_prefork
Considering conflict mpm_event for mpm_prefork:
Considering conflict mpm_worker for mpm_prefork:
Module mpm_prefork already enabled
pi@raspberrypi:~ $ sudo systemctl restart apache2
Job for apache2.service failed because the control process exited with error code.
See “systemctl status apache2.service” and “journalctl -xe” for details.
pi@raspberrypi:~ $

typing IP address still does not open the login page

typing the IP I get this message:

safari cannot open the page because the connection to the server failed
I activated ssl therefore the automatic redirection https:// etc etc
I noticed, if I only type the IP I am redirected to www…
I checked the file but everything is set correctly (I also deleted the browsing history on the various browsers I use) but nothing…

pi@raspberrypi:~ $ sudo systemctl restart apache2
Job for apache2.service failed because the control process exited with error code.
See “systemctl status apache2.service” and “journalctl -xe” for details.

Reason is there.

2 Likes

Blockquote
pi@raspberrypi:~ $ systemctl status apache2.service
● apache2.service - The Apache HTTP Server
Loaded: loaded (/lib/systemd/system/apache2.service; enabled; vendor preset: enabled)
Active: failed (Result: exit-code) since Fri 2023-11-17 00:09:45 CET; 19h ago
Docs: Apache HTTP Server Version 2.4 Documentation - Apache HTTP Server Version 2.4
Process: 15189 ExecStart=/usr/sbin/apachectl start (code=exited, status=1/FAILURE)
CPU: 91ms

nov 17 00:09:45 raspberrypi apachectl[15192]: AH00558: apache2: Could not reliably determine the server’s fully qual>
nov 17 00:09:45 raspberrypi apachectl[15192]: (2)No such file or directory: AH02291: Cannot access directory '/var/l>
nov 17 00:09:45 raspberrypi apachectl[15192]: (2)No such file or directory: AH02291: Cannot access directory '/var/l>
nov 17 00:09:45 raspberrypi apachectl[15192]: (2)No such file or directory: AH02291: Cannot access directory '/var/l>
nov 17 00:09:45 raspberrypi apachectl[15192]: AH00014: Configuration check failed
nov 17 00:09:45 raspberrypi apachectl[15189]: Action ‘start’ failed.
nov 17 00:09:45 raspberrypi apachectl[15189]: The Apache error log may have more information.
nov 17 00:09:45 raspberrypi systemd[1]: apache2.service: Control process exited, code=exited, status=1/FAILURE
nov 17 00:09:45 raspberrypi systemd[1]: apache2.service: Failed with result ‘exit-code’.
nov 17 00:09:45 raspberrypi systemd[1]: Failed to start The Apache HTTP Server.
pi@raspberrypi:~ $ journalctl -xe
░░
░░ La fase di avvio è done.
nov 17 19:24:33 raspberrypi systemd[24403]: Listening on D-Bus User Message Bus Socket.
░░ Subject: L’unità UNIT ha terminato la fase di avvio
░░ Defined-By: systemd
░░ Support: Debian -- User Support
░░
░░ L’unità UNIT ha terminato la fase di avvio.
░░
░░ La fase di avvio è done.
nov 17 19:24:33 raspberrypi systemd[24403]: Reached target Sockets.
░░ Subject: L’unità UNIT ha terminato la fase di avvio
░░ Defined-By: systemd
░░ Support: Debian -- User Support
░░
░░ L’unità UNIT ha terminato la fase di avvio.
░░
░░ La fase di avvio è done.
nov 17 19:24:33 raspberrypi systemd[24403]: Reached target Basic System.
░░ Subject: L’unità UNIT ha terminato la fase di avvio
░░ Defined-By: systemd
░░ Support: Debian -- User Support
░░
░░ L’unità UNIT ha terminato la fase di avvio.
░░
░░ La fase di avvio è done.
nov 17 19:24:33 raspberrypi systemd[24403]: Reached target Main User Target.
░░ Subject: L’unità UNIT ha terminato la fase di avvio
░░ Defined-By: systemd
░░ Support: Debian -- User Support
░░
░░ L’unità UNIT ha terminato la fase di avvio.
░░
░░ La fase di avvio è done.
nov 17 19:24:33 raspberrypi systemd[24403]: Startup finished in 263ms.
░░ Subject: L’istanza di gestione per l’utente è completata
░░ Defined-By: systemd
░░ Support: Debian -- User Support
░░
░░ L’istanza di gestione per l’utente 1000 è stata avviata. Tutti i servizi
░░ interrogati sono stati avviati. Altri servizi potrebbero essere ancora in
░░ fase di avvio o in attesa di essere avviati.
░░
░░ L’avvio dell’istanza ha impiegato 263066 microsecondi.
nov 17 19:24:33 raspberrypi systemd[1]: Started User Manager for UID 1000.
░░ Subject: L’unità user@1000.service ha terminato la fase di avvio
░░ Defined-By: systemd
░░ Support: Debian -- User Support
░░
░░ L’unità user@1000.service ha terminato la fase di avvio.
░░
░░ La fase di avvio è done.
nov 17 19:24:33 raspberrypi systemd[1]: Started Session 157 of user pi.
░░ Subject: L’unità session-157.scope ha terminato la fase di avvio
░░ Defined-By: systemd
░░ Support: Debian -- User Support
░░
░░ L’unità session-157.scope ha terminato la fase di avvio.
░░
░░ La fase di avvio è done.
lines 2850-2909/2909 (END)

Hey,

i think the output above is stripped and doesn’t include the full log output and it is e.g. stripped here at the >:

nov 17 00:09:45 raspberrypi apachectl[15192]: AH00558: apache2: Could not reliably determine the server’s fully qual>
nov 17 00:09:45 raspberrypi apachectl[15192]: (2)No such file or directory: AH02291: Cannot access directory '/var/l>

I’m also not sure how much the ownCloud community is able to give configuration support for Apache issues. Maybe Apache HTTP Server Support - The Apache HTTP Server Project could be a better help?

1 Like

Once again:

  • Locate your definition of /var/l
  • Either fix it to the proper value, pointing to an existing directory.
2 Likes