Owncloud 10 says wrong version of PHP although latest version is installed


#1

Please help us by providing the following info. Before posting please also check the pinned "Known issues" threads and make sure that you're running the latest available version for your oC release: https://owncloud.org/changelog/

Expected behaviour
I'd like to open my Owncloud instance on the server

Actual behaviour
When putting in the URLS I get this message

This version of ownCloud requires at least PHP 5.6.0
You are currently running 5.5.9-1ubuntu4.21. Please update your PHP version.

Server configuration
Operating system: Ubunto 14.04 Server
Web server: Apache
Database: MySQL
PHP version: 7.1
ownCloud version (see ownCloud admin page):
<?php
$OC_Version = array(10,0,0,12);
$OC_VersionString = '10.0.0';
$OC_Channel = 'stable';
$OC_VersionCanBeUpgradedFrom = array(9,1);
$OC_Build = '2017-04-26T11:44:04+00:00 ce40499f02717afa0af25bf2f67629a3159a29d3';

Updated from an older ownCloud or fresh install:
updated from 9.1 via apt-get upgrade

ownCloud configuration

no possible: when I perform : on the command line: sudo -u www-data php occ config:list system

I get

An unhandled exception has been thrown:
Doctrine\DBAL\DBALException: Failed to connect to the database: An exception occured in driver: could not find driver in /var/www/owncloud/lib/private/DB/Connection.php:63
Stack trace:

0 /var/www/owncloud/lib/composer/doctrine/dbal/lib/Doctrine/DBAL/Connection.php(429): OC\DB\Connection->connect()

1 /var/www/owncloud/lib/composer/doctrine/dbal/lib/Doctrine/DBAL/Connection.php(389): Doctrine\DBAL\Connection->getDatabasePlatformVersion()

2 /var/www/owncloud/lib/composer/doctrine/dbal/lib/Doctrine/DBAL/Connection.php(328): Doctrine\DBAL\Connection->detectDatabasePlatform()

3 /var/www/owncloud/lib/composer/doctrine/dbal/lib/Doctrine/DBAL/Connection.php(623): Doctrine\DBAL\Connection->getDatabasePlatform()

4 /var/www/owncloud/lib/private/DB/Connection.php(146): Doctrine\DBAL\Connection->setTransactionIsolation(2)

5 /var/www/owncloud/lib/composer/doctrine/dbal/lib/Doctrine/DBAL/DriverManager.php(172): OC\DB\Connection->__construct(Array, Object(Doctrine\DBAL\Driver\PDOMySql\Driver), Object(Doctrine\DBAL\Configuration), Object(Doctrine\Common\EventManager))

6 /var/www/owncloud/lib/private/DB/ConnectionFactory.php(136): Doctrine\DBAL\DriverManager::getConnection(Array, Object(Doctrine\DBAL\Configuration), Object(Doctrine\Common\EventManager))

7 /var/www/owncloud/lib/private/Server.php(461): OC\DB\ConnectionFactory->getConnection('mysql', Array)

8 /var/www/owncloud/lib/composer/pimple/pimple/src/Pimple/Container.php(113): OC\Server->OC{closure}(Object(OC\Server))

9 /var/www/owncloud/lib/private/AppFramework/Utility/SimpleContainer.php(111): Pimple\Container->offsetGet('DatabaseConnect...')

10 /var/www/owncloud/lib/private/ServerContainer.php(87): OC\AppFramework\Utility\SimpleContainer->query('DatabaseConnect...')

11 /var/www/owncloud/lib/private/Server.php(1101): OC\ServerContainer->query('DatabaseConnect...')

12 /var/www/owncloud/lib/private/Server.php(226): OC\Server->getDatabaseConnection()

13 /var/www/owncloud/lib/composer/pimple/pimple/src/Pimple/Container.php(113): OC\Server->OC{closure}(Object(OC\Server))

14 /var/www/owncloud/lib/private/AppFramework/Utility/SimpleContainer.php(111): Pimple\Container->offsetGet('UserManager')

15 /var/www/owncloud/lib/private/ServerContainer.php(87): OC\AppFramework\Utility\SimpleContainer->query('UserManager')

16 /var/www/owncloud/lib/private/Server.php(953): OC\ServerContainer->query('UserManager')

17 /var/www/owncloud/lib/private/Server.php(267): OC\Server->getUserManager()

18 /var/www/owncloud/lib/composer/pimple/pimple/src/Pimple/Container.php(113): OC\Server->OC{closure}(Object(OC\Server))

19 /var/www/owncloud/lib/private/AppFramework/Utility/SimpleContainer.php(111): Pimple\Container->offsetGet('UserSession')

20 /var/www/owncloud/lib/private/ServerContainer.php(87): OC\AppFramework\Utility\SimpleContainer->query('UserSession')

21 /var/www/owncloud/lib/private/Server.php(970): OC\ServerContainer->query('UserSession')

22 /var/www/owncloud/lib/private/Server.php(507): OC\Server->getUserSession()

23 /var/www/owncloud/lib/composer/pimple/pimple/src/Pimple/Container.php(113): OC\Server->OC{closure}(Object(OC\Server))

24 /var/www/owncloud/lib/private/AppFramework/Utility/SimpleContainer.php(111): Pimple\Container->offsetGet('AppManager')

25 /var/www/owncloud/lib/private/ServerContainer.php(87): OC\AppFramework\Utility\SimpleContainer->query('AppManager')

26 /var/www/owncloud/lib/private/Server.php(1288): OC\ServerContainer->query('AppManager')

27 /var/www/owncloud/lib/private/legacy/app.php(310): OC\Server->getAppManager()

28 /var/www/owncloud/lib/private/legacy/app.php(106): OC_App::getEnabledApps()

29 /var/www/owncloud/lib/base.php(579): OC_App::loadApps(Array)

30 /var/www/owncloud/lib/base.php(994): OC::init()

31 /var/www/owncloud/console.php(57): require_once('/var/www/ownclo...')

32 /var/www/owncloud/occ(11): require_once('/var/www/ownclo...')

33 {main}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/owncloud/lib/private/DB/Connection.php:63

Stack trace:

0 /var/www/owncloud/lib/composer/doctrine/dbal/lib/Doctrine/DBAL/Connection.php(429): OC\DB\Connection->connect()

1 /var/www/owncloud/lib/composer/doctrine/dbal/lib/Doctrine/DBAL/Connection.php(389): Doctrine\DBAL\Connection->getDatabasePlatformVersion()

2 /var/www/owncloud/lib/composer/doctrine/dbal/lib/Doctrine/DBAL/Connection.php(328): Doctrine\DBAL\Connection->detectDatabasePlatform()

3 /var/www/owncloud/lib/composer/doctrine/dbal/lib/Doctrine/DBAL/Connection.php(623): Doctrine\DBAL\Connection->getDatabasePlatform()

4 /var/www/owncloud/lib/private/DB/Connection.php(146): Doctrine\DBAL\Connection->setTransactionIsolation(2)

5 /var/www/owncloud/lib/composer/doctrine/dbal/lib/Doctrine/DBAL/DriverManager.php(172): OC\DB\Connection->__construct(Array, Object(Doctrine\DBAL\Driver\PDOMySql\Driver), Object(Doctrine\D in /var/www/owncloud/lib/private/DB/Connection.php on line 63


Thanks for any hint

Georg


#2

This version can't be wrong as oC is using a PHP native function / constant to get the current PHP version. You will also get the same result / version 5.5.9 shown when putting a phpinfo side-by-side to the ownCloud files.

This shows that your PHP environment / webserver is mis-configured to run .php files via the mentioned (outdated) PHP version as pointed out in this message.

An exception occured in driver: could not

This shows that your php cli version (this has a different php.ini and loads modules / extensions separately) is missing the needed PHP DB driver.

If you need support on how to correctly configure both, a newer PHP version and the DB driver in your environment please jump over to one of the resources listed at [1].

[1] https://community.ubuntu.com/contribute/support


#3

If this is your own server, I would consider upgrading to Ubuntu 16.04, then you have PHP 7.0 with better performance and you can use the native caching packages. With 14.04 you need backports or other 3rd-party packages, especially if you start a setup, I'd try to avoid it.


#4

Hi tflidd,

I've updated the server to 16.04 but when running
sudo -u www-data php /var/www/owncloud/occ
I get the same error

An unhandled exception has been thrown:
Doctrine\DBAL\DBALException: Failed to connect to the database: An exception occured in driver: could not find driver in /var/www/owncloud/lib/private/DB/Connection.php:63

Any idea?

Thanks

Georg


#5

See the previous comment about that:


#6

Hi,

just for information.

The problem was solved after I've installed all requested packages from php 7.0 and 7.1 in parallel.
Georg