Trouble with php version

Hello,
after a Ubuntu Upgrade is the answer from “sudo -u www-data php /var/www/owncloud/occ status”

This version of ownCloud is not compatible with PHP 8.0
You are currently running PHP 8.1.9.

So I have made a Downgrade with “sudo apt install php7.3”

Owncloud say:
This version of ownCloud is not compatible with PHP 8.0
You are currently running PHP 8.1.9.

PHPinfo say:
PHP Version 7.2.34-33+ubuntu18.04.1+deb.sury.org+1

The System is:
Linux Homeserver 4.15.0-191-generic #202-Ubuntu SMP Thu Aug 4 01:49:05 UTC 2022 i686

can you please help me?

Hi JoergB,

ownCloud is - as you could read - not compatible with PHP 8. You will have to downgrade PHP to 7.4 to have it running again.

There is a guide in the official docs:

Let us know, if you run into any difficulties

1 Like

Hello,
THX for your Help!!

i have installed php7.4 then i have with sudo update-alternatives --config php switchd to php7.4

Auswahl Pfad Priorität Status

0 /usr/bin/php8.1 81 automatischer Modus
1 /usr/bin/php7.2 72 manueller Modus
2 /usr/bin/php7.3 73 manueller Modus

  • 3 /usr/bin/php7.4 74 manueller Modus
    4 /usr/bin/php8.1 81 manueller Modus

sudo -u www-data php /var/www/owncloud/occ status i get this:
Error: Class ‘\OC\Memcache\APC’ not found in /var/www/owncloud/lib/private/Memcache/Factory.php:89
Stack trace:
#0 /var/www/owncloud/lib/private/Server.php(465): OC\Memcache\Factory->__construct()
#1 /var/www/owncloud/lib/composer/pimple/pimple/src/Pimple/Container.php(122): OC\Server->OC{closure}()
#2 /var/www/owncloud/lib/private/AppFramework/Utility/SimpleContainer.php(108): Pimple\Container->offsetGet()
#3 /var/www/owncloud/lib/private/ServerContainer.php(86): OC\AppFramework\Utility\SimpleContainer->query()
#4 /var/www/owncloud/lib/private/Server.php(1242): OC\ServerContainer->query()
#5 /var/www/owncloud/lib/base.php(834): OC\Server->getMemCacheFactory()
#6 /var/www/owncloud/lib/base.php(574): OC::registerAutoloaderCache()
#7 /var/www/owncloud/lib/base.php(1071): OC::init()
#8 /var/www/owncloud/console.php(74): require_once(’/var/www/ownclo…’)
#9 /var/www/owncloud/occ(11): require_once(’/var/www/ownclo…’)
#10 {main}joerg@Homeserver:~$

When i start the owncloud startsite i get this:

This version of ownCloud requires at least PHP 7.3.0
You are currently running PHP 7.2.34-33+ubuntu18.04.1+deb.sury.org+1. Please update your PHP version. :face_with_diagonal_mouth:

And now i don’t know anything… :face_with_spiral_eyes:

For ownCloud both command line (CLI) PHP and the apache module have to be the same version.
You already managed to fix the CLI variant, but your apache is still using the old module. Usually the following lines (run as root/sudo) should fix this issue:

a2dismod php7.2
a2enmod php7.4
systemctl restart apache2

Does it work for you?

For the APCu issue I found that nextcloud thread: https://www.linuxquestions.org/questions/linux-server-73/problems-enabling-apcu-in-php-cli-4175700714/

So I guess calling occ with

sudo -u www-data php --define apc.enable_cli=1 /var/www/owncloud/occ status

occ should work as well

1 Like

[quote=“cortho, post:4, topic:38889”]
Does it work for you?
[/quote]No! Now i have a blank white Screen!! :grin: :grin: :grin:

And sudo -u www-data php --define apc.enable_cli=1 /var/www/owncloud/occ status
gives again:

An unhandled exception has been thrown:
Error: Class ‘\OC\Memcache\APC’ not found in /var/www/owncloud/lib/private/Memcache/Factory.php:89
Stack trace:
#0 /var/www/owncloud/lib/private/Server.php(465): OC\Memcache\Factory->__construct()
#1 /var/www/owncloud/lib/composer/pimple/pimple/src/Pimple/Container.php(122): OC\Server->OC{closure}()
#2 /var/www/owncloud/lib/private/AppFramework/Utility/SimpleContainer.php(108): Pimple\Container->offsetGet()
#3 /var/www/owncloud/lib/private/ServerContainer.php(86): OC\AppFramework\Utility\SimpleContainer->query()
#4 /var/www/owncloud/lib/private/Server.php(1242): OC\ServerContainer->query()
#5 /var/www/owncloud/lib/base.php(834): OC\Server->getMemCacheFactory()
#6 /var/www/owncloud/lib/base.php(574): OC::registerAutoloaderCache()
#7 /var/www/owncloud/lib/base.php(1071): OC::init()
#8 /var/www/owncloud/console.php(74): require_once(’/var/www/ownclo…’)
#9 /var/www/owncloud/occ(11): require_once(’/var/www/ownclo…’)
#10 {main}joerg@Homeserver:~$ ^C

So we are one step further :slight_smile:

Is the apcu module installed?

apt install php7.4-apcu

Which exceptions are shown in owncloud,log?

It is the newest Version.

php7.4-apcu ist schon die neueste Version (5.1.21+4.0.11-8+ubuntu18.04.1+deb.sury.org+1).
php7.4-apcu wurde als manuell installiert festgelegt.

owncloud.log: (only the last entry)

{“reqId”:“25… …c6”,“level”:4,“time”:“2022-08-30T12:27:15+00:00”,“remoteAddr”:“XXX.XXX.XXX.XXX”,“user”:"–",“app”:“remote”,“method”:“GET”,“url”:"/status.php",“message”:“Class ‘\OC\Memcache\APC’ not found”}

Now generaly PHP is not working - I have tested it with a other script.

Ist there a typo in your config.php? The line should read
'memcache.local' => '\\OC\\Memcache\\APCu',

I don’t think so, the owncloud.log entry was written by PHP :wink:

Yes, there was a typo! :slight_smile: I have it changed it from
'memcache.local' => '\\OC\\Memcache\\APC'
to
'memcache.local' => '\\OC\\Memcache\\APCu'

But why this??? I don’t have changed anything in this file!!!

sudo -u www-data php /var/www/owncloud/occ status
gives now:

An unhandled exception has been thrown:
Doctrine\DBAL\DBALException: Failed to connect to the database: An exception occurred in driver: could not find driver in /var/www/owncloud/lib/private/DB/Connection.php:62
Stack trace:
#0 /var/www/owncloud/lib/composer/doctrine/dbal/lib/Doctrine/DBAL/Connection.php(475): OC\DB\Connection->connect()
#1 /var/www/owncloud/lib/composer/doctrine/dbal/lib/Doctrine/DBAL/Connection.php(437): Doctrine\DBAL\Connection->getDatabasePlatformVersion()
#2 /var/www/owncloud/lib/composer/doctrine/dbal/lib/Doctrine/DBAL/Connection.php(379): Doctrine\DBAL\Connection->detectDatabasePlatform()
#3 /var/www/owncloud/lib/composer/doctrine/dbal/lib/Doctrine/DBAL/Connection.php(844): Doctrine\DBAL\Connection->getDatabasePlatform()
#4 /var/www/owncloud/lib/private/DB/Connection.php(148): Doctrine\DBAL\Connection->setTransactionIsolation()
#5 /var/www/owncloud/lib/composer/doctrine/dbal/lib/Doctrine/DBAL/DriverManager.php(262): OC\DB\Connection->__construct()
#6 /var/www/owncloud/lib/private/DB/ConnectionFactory.php(139): Doctrine\DBAL\DriverManager::getConnection()
#7 /var/www/owncloud/lib/private/Server.php(552): OC\DB\ConnectionFactory->getConnection()
#8 /var/www/owncloud/lib/composer/pimple/pimple/src/Pimple/Container.php(122): OC\Server->OC{closure}()
#9 /var/www/owncloud/lib/private/AppFramework/Utility/SimpleContainer.php(108): Pimple\Container->offsetGet()
#10 /var/www/owncloud/lib/private/ServerContainer.php(86): OC\AppFramework\Utility\SimpleContainer->query()
#11 /var/www/owncloud/lib/private/Server.php(1260): OC\ServerContainer->query()
#12 /var/www/owncloud/lib/private/Server.php(424): OC\Server->getDatabaseConnection()
#13 /var/www/owncloud/lib/composer/pimple/pimple/src/Pimple/Container.php(122): OC\Server->OC{closure}()
#14 /var/www/owncloud/lib/private/AppFramework/Utility/SimpleContainer.php(108): Pimple\Container->offsetGet()
#15 /var/www/owncloud/lib/private/ServerContainer.php(86): OC\AppFramework\Utility\SimpleContainer->query()
#16 /var/www/owncloud/lib/private/Server.php(1190): OC\ServerContainer->query()
#17 /var/www/owncloud/lib/private/Server.php(607): OC\Server->getAppConfig()
#18 /var/www/owncloud/lib/composer/pimple/pimple/src/Pimple/Container.php(122): OC\Server->OC{closure}()
#19 /var/www/owncloud/lib/private/AppFramework/Utility/SimpleContainer.php(108): Pimple\Container->offsetGet()
#20 /var/www/owncloud/lib/private/ServerContainer.php(86): OC\AppFramework\Utility\SimpleContainer->query()
#21 /var/www/owncloud/lib/private/Server.php(1458): OC\ServerContainer->query()
#22 /var/www/owncloud/lib/private/legacy/app.php(344): OC\Server->getAppManager()
#23 /var/www/owncloud/lib/private/legacy/app.php(108): OC_App::getEnabledApps()
#24 /var/www/owncloud/lib/base.php(591): OC_App::loadApps()
#25 /var/www/owncloud/lib/base.php(1071): OC::init()
#26 /var/www/owncloud/console.php(74): require_once(’/var/www/ownclo…’)
#27 /var/www/owncloud/occ(11): require_once(’/var/www/ownclo…’)
#28 {main}joerg@Homeserver:~$

No, PHP is not working. I have posted the last entry in this file.

Now it works!!! :grinning:

I installed again php 7.4 mysql , zip , curl etc and then it worked !!! :grinning:

@cortho Big big THANKS for your Help !!!

2 Likes

PHP7.4 EOL is in 3 months. Is there plans to support PHP 8.1 prior to 7.4 reaching EOL? No security patches will be released for PHP7.4 once this happens. I do not plan on supporting PHP7x on my server once this happens and then my owncloud setup will break at that time. Please release an update before EOL occurs for 7.4.

Thanks.

There won’t be any support of PHP 8. Tons of posts are on that topic, please use the search function.