Closed montanaviking closed 7 years ago
@montanaviking
Failed to connect to the database: An exception occured in driver: could not find driver
This shows that there is a misconfiguration in your PHP environment where the database driver is not correctly loaded. Please close here and ask for support on how to configure this correctly at the resources listed at https://secure.php.net/support.php
kdslkdsaldsal, thanks very much for looking at this. However, I would think that if PHP were misconfigured, then phpMyAdmin would also not function. However, phpMyAdmin functions with the same PHP configuration that the ownCloud 10 install failed on. Moreover, phpMyAdmin can access my MySQL database just fine. I don't want to change any configurations on PHP unless this is clearly the cause of my problem. Then again, just maybe said PHP configuration could selectively fail Owncloud 10? Any help in looking into this would be welcome because I'm a noob on PHP. Thanks, Phil
There are differences between your webserver (running phpmyadmin and owncloud via browser) and the php cli (which is called by occ). Your webserver module has loaded the correct db driver, your php cli on command line not.
If you need further support with this please contact the PHP support community as already advised.
Hi Again, My problem appears to be similar to that posted in: https://github.com/owncloud/core/issues/23130 and from this post I noticed: ######################### I had the same problem concerning what you've cited above: "exception 'Doctrine\DBAL\DBALException' with message 'Failed to connect to the database: An exception occured in driver: could not find driver' in /var/www/owncloud/lib/private/db/connection.php:54"
I solved it. The problem (in my case) was caused by different php version for 'the command line' and for the serving side via 'apache'. occ needs to use the same php version.
check the php version at the command line 'php -v' for example PHP7.0.2
check the php version which the serving-side is using via e.g. creating a info.php with the content: ""
this gives as output e.g. PHP 5.6.17
So the difference is PHP7.0.2 and PHP5.6.17. Btw the occ command is php based also.
I solved the problem by installing PHP5.6.17 at the 'command line' side as well so it is the same as at 'serving side'.
But we're not there yet in case you have multiple php versions on your system. If the 'php -v' doesn't give PHP5.6.17 you have to create a new alias for php (assuming the correct version is also stored in the file system, otherwise install it). Locate the correct php version with 'whereis php'. Change the alias to the correct path until the 'php -v' gives the same version as the 'serving side' php version. ############################################ Perhaps my phpMyAdmin installation uses a different version of php than OC or is indicating the wrong version? I think my root cause is similar to other recent posters' issues with Ubuntu 14.04 and OC 9x->10 upgrade. Apparently, this required upgrading PHP from 5.5.9 to 5.6.x and Ubuntu 14.04 uses PHP 5.5.9. So, it appears that I need to upgrade my PHP to at least 5.6.x but I have two questions namely:
Sorry, I didn't see your latest post. I'm going to check my PHP installation and try to correct it. thanks, Phil
@montanaviking According to your report
sudo apt-get install php5.6 php5.6-mbstring php5.6-mcrypt php5.6-mysql php5.6-xml php5.6-apcu php5.6-zip php5.6-gd php5.6-curl sudo a2dismod php5 sudo a2enmod php5.6 ... php -v PHP 7.1.4-1
your webserver uses PHP5.6 (with php5.6-mysql ) - any database related code requested via web from the server (owncloud, phpmyadmin, etc) will work
your CLI uses PHP 7 (most likely without php7.0-mysql) will not work
to check this please run php -m
from CLI and look for MySQL in the list of enabled modules
Install php5.6-cli package additionally
@montanaviking as I see from your last post you already solved that.
will ownCloud 10 work with PHP 7.x?
yes.
sudo a2dismod php5 sudo a2enmod php5.6
these lines mean
Hey, apache webserver, stop using php5 module
and
Hey, apache webserver, start using php5.6 module
As you see PHP can be packed as Apache module. These packages are usually called libapache2-mod-phpX.Y
CLI version of PHP is inside the package phpX.Y-cli
Packages like phpX.Y-something
are modules of PHP itself. They are used both for Apache PHP module and PHP CLI given that they are compatible. 5.6 and 7.0 are not compatible from the point of modules. Which means that e.g. php5.6-mysql
package is needed for 5.6 and php7.0-mysql
is need for 7.0
IIRC It is possible to have 5.6 and 7.0 installed simultaneously and use it as follows
sudo -u www-data php5.6 occ upgrade
sudo -u www-data php7.0 occ upgrade
php
is just a symlink to either php5.6
or php7.0
in this case
Hi, In order to solve my owncloud 9.1.5 to 10.x upgrade problem, I would like to upgrade my php from 5.5.9 to php 7.0.15, Apache 2.4.7 to Apache 2.4.18, and MySQL 5.5.55 to MySQL 5.7.18. I'm currently running Ubuntu 14.04 and will eventually upgrade to Ubuntu 16.04, but before that, I'd like to put my PHP, Apache, and MySQL at the 16.04 versions (as above), run my present OC 9.1.5 now, and eventually upgrade OC from 9.1.5 to OC 10.0 or 10.1 (later). I like the idea of having 16.04's versions of the above working prior to migrating to 16.04.
My questions are:
How do I upgrade Apache, PHP, and MySQL in a way that doesn't break my current OC 9.1.5? Are there settings in OC 9.1.5 configurations which need to be adjusted to the new Apache, PHP, and/or MySQL as above? I have looked at my owncloud/config/config.php file and didn't see anything regarding versions of the above (PHP, Apache, MySQL). Is the OC 9.1.5 agnostic regarding this or do I need to inform it as to my changes/upgrades?
Also, if anyone here knows, should I do the above, can I migrate back to my former Apache, MySQL,PHP versions should other things break or will that break my OC database? Of course, I will back up my OC database. Thanks so much, Phil
I will probably not bother upgrading MySQL since OC 10.x will likely work with my present MySQL 5.5.55 and I'd like to let "sleeping dogs lie". Thanks
@montanaviking Please note this is a bugtracker for ownCloud where (as the name is saying) bugs for ownCloud are tracked / handled. Support questions like yours needs to go to:
@VicDeo Why keeping this open as this is clearly an environmental issue?
I have posted this question in https://central.owncloud.org/ and closed this thread.
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.