You are not logged in.

#1 2011-12-07 12:09:12

ReaphSharc
Member
From: the Netherlands
Registered: 2007-11-05
Posts: 138
Website

Mediawiki - PHP - MySQL: Could not find a suitable database driver!

I've been trying to get a webserver on my pc to work, because I want to use a wiki on it. I've tried several over the past few years, but for this project, MediaWiki well be my best choice. Unfortunately, I get this error when trying to install MediaWiki (1.18.0):

http://localhost/wiki/mw-config/index.php wrote:

PHP 5.3.8 is installed.

Could not find a suitable database driver! You need to install a database driver for PHP. The following database types are supported: MySQL, PostgreSQL, Oracle, SQLite, IBM DB2.

If you are on shared hosting, ask your hosting provider to install a suitable database driver. If you compiled PHP yourself, reconfigure it with a database client enabled, for example using ./configure --with-mysql. If you installed PHP from a Debian or Ubuntu package, then you also need install the php5-mysql module.

GNU diff3 not found.

I've installed Apache, MySQL and PHP, edited the Apache config to handle php files, and php.ini to enable the MySQL modules (both). When I look at the php enviromental variables, it seems to be able to find MySQL just fine:

mysqlMySQL Support    enabled
Active Persistent Links     0
Active Links     0
Client API version     mysqlnd 5.0.8-dev - 20102224 - $Revision: 310735 $

Directive    Local Value    Master Value
mysql.allow_local_infile    On    On
mysql.allow_persistent    On    On
mysql.connect_timeout    60    60
mysql.default_host    localhost    localhost
mysql.default_password    no value    no value
mysql.default_port    3306    3306
mysql.default_socket    /var/run/mysqld/mysqld.sock    /var/run/mysqld/mysqld.sock
mysql.default_user    root    root
mysql.max_links    Unlimited    Unlimited
mysql.max_persistent    Unlimited    Unlimited
mysql.trace_mode    Off    Offp

Also, I found no errors in the errorlog. MySQL process is running and I can access it from the command line as well as through Workbench.
I'm obviously missing something, but no idea what it is.

The missing diff3 error is also annoying, because it's on my system:

> which diff3
/usr/bin/diff3

Do you want a Bubble Icon? Feel free to submit your requests or personal creations to be included in future releases.
I'm 100% Linux!

Offline

#2 2011-12-07 13:14:15

.:B:.
Forum Fellow
Registered: 2006-11-26
Posts: 5,819
Website

Re: Mediawiki - PHP - MySQL: Could not find a suitable database driver!

$ php -m

should show you what modules you enabled and whether they are present on the system.


Got Leenucks? :: Arch: Power in simplicity :: Get Counted! Registered Linux User #392717 :: Blog thingy

Offline

#3 2011-12-07 18:59:02

ReaphSharc
Member
From: the Netherlands
Registered: 2007-11-05
Posts: 138
Website

Re: Mediawiki - PHP - MySQL: Could not find a suitable database driver!

> php -m|grep mysql
mysql
mysqli
mysqlnd

Should there be a mysql module in Apache (httpd.conf). There's none on my system, can't find one with pacman and can't find a mod_mysql.so-like file on my system either. Just taking wild pokes, hoping to solve this.


Do you want a Bubble Icon? Feel free to submit your requests or personal creations to be included in future releases.
I'm 100% Linux!

Offline

#4 2011-12-07 19:57:50

Xabre
Member
From: Serbia
Registered: 2009-03-19
Posts: 757

Re: Mediawiki - PHP - MySQL: Could not find a suitable database driver!

cat /etc/php/php.ini | grep 'mysql.so\|mysqli.so'

Should be enabled there, not in httpd.conf.

OK, to explain further: php -m shows a list of available extensions/modules, but you still have to enable needed ones in php.ini (just remove comment - ";" sign - at the beginning of the line).

Last edited by Xabre (2011-12-07 20:08:09)

Offline

#5 2011-12-07 20:58:57

.:B:.
Forum Fellow
Registered: 2006-11-26
Posts: 5,819
Website

Re: Mediawiki - PHP - MySQL: Could not find a suitable database driver!

Available as in loaded right, or am I wrong about that?

No need to use cat with grep btw wink.


Got Leenucks? :: Arch: Power in simplicity :: Get Counted! Registered Linux User #392717 :: Blog thingy

Offline

#6 2011-12-07 21:16:16

Xabre
Member
From: Serbia
Registered: 2009-03-19
Posts: 757

Re: Mediawiki - PHP - MySQL: Could not find a suitable database driver!

.:B:. wrote:

Available as in loaded right, or am I wrong about that?

Available as in installed, but you still have to enable their loading in php.ini, at least as I see it.

[22:08:21] slobo ~ $  php -m | grep pgsql                                                                       
pdo_pgsql
pgsql
[22:08:35] slobo ~ $  grep pgsql.so /etc/php/php.ini
;extension=pdo_pgsql.so
;extension=pgsql.so

(if that's some sort of a bug with my system, I for one vote for not fixing it smile )

No need to use cat with grep btw wink.

Old habits, even wrong ones, die very, very hard. smile

Offline

#7 2011-12-07 21:34:21

Pierre
Developer
From: Bonn
Registered: 2004-07-05
Posts: 1,967
Website

Re: Mediawiki - PHP - MySQL: Could not find a suitable database driver!

php -m shows all modules that are either built-in or which are currently loaded via php.ini. And no it does not show modules that are installed but not enabled via php.ini.

Also make sure that your php.ini and probably other config files are valid and have no errors which might result in strange behavior.

Offline

#8 2011-12-07 22:17:13

Xabre
Member
From: Serbia
Registered: 2009-03-19
Posts: 757

Re: Mediawiki - PHP - MySQL: Could not find a suitable database driver!

Thx for clarification on that matter. Yes, I'm using a quite old config for php, but haven't had any issues so far( except this, obviously), and everything works (I use local LAMP just for local testing before sending to server, so nothing that really matters).

I guess apologies would be in order for misleading on this topic. Sorry 'bout that.

Offline

#9 2011-12-08 12:57:24

ReaphSharc
Member
From: the Netherlands
Registered: 2007-11-05
Posts: 138
Website

Re: Mediawiki - PHP - MySQL: Could not find a suitable database driver!

All mysql modules are (and were) enabled in php.ini. Still can't figure out why this isn't working. Can it be a bug in MediaWiki 1.18.0?
This is a very annoying problem since at work (I'm a sysadmin) this sort of setup with Ubuntu or Redhat is just a few minutes of work on a fresh server. hmm


Do you want a Bubble Icon? Feel free to submit your requests or personal creations to be included in future releases.
I'm 100% Linux!

Offline

#10 2011-12-08 18:14:55

Pierre
Developer
From: Bonn
Registered: 2004-07-05
Posts: 1,967
Website

Re: Mediawiki - PHP - MySQL: Could not find a suitable database driver!

This is most likely a problem in your config files. I have running 1.8.0 here without any problems. Does a phpinfo file list the mysql modules?

Offline

#11 2011-12-09 09:45:27

ReaphSharc
Member
From: the Netherlands
Registered: 2007-11-05
Posts: 138
Website

Re: Mediawiki - PHP - MySQL: Could not find a suitable database driver!

ReaphSharc wrote:

I've installed Apache, MySQL and PHP, edited the Apache config to handle php files, and php.ini to enable the MySQL modules (both). When I look at the php enviromental variables, it seems to be able to find MySQL just fine:

mysqlMySQL Support    enabled
Active Persistent Links     0
Active Links     0
Client API version     mysqlnd 5.0.8-dev - 20102224 - $Revision: 310735 $

Directive    Local Value    Master Value
mysql.allow_local_infile    On    On
mysql.allow_persistent    On    On
mysql.connect_timeout    60    60
mysql.default_host    localhost    localhost
mysql.default_password    no value    no value
mysql.default_port    3306    3306
mysql.default_socket    /var/run/mysqld/mysqld.sock    /var/run/mysqld/mysqld.sock
mysql.default_user    root    root
mysql.max_links    Unlimited    Unlimited
mysql.max_persistent    Unlimited    Unlimited
mysql.trace_mode    Off    Off

(the data above is from my info.php file)


Do you want a Bubble Icon? Feel free to submit your requests or personal creations to be included in future releases.
I'm 100% Linux!

Offline

#12 2012-01-06 16:08:10

benpage
Member
Registered: 2012-01-06
Posts: 2

Re: Mediawiki - PHP - MySQL: Could not find a suitable database driver!

Did you figure this out? I'm having the same problem: phpinfo and php - m say the mysql extension is enabled, but Media Wiki says it's not. I'm new to Arch Linux, but not Linux (Debian) or Media Wiki.

Offline

#13 2012-01-06 16:19:04

benpage
Member
Registered: 2012-01-06
Posts: 2

Re: Mediawiki - PHP - MySQL: Could not find a suitable database driver!

More Details:
1. I made a test PHP page. It was able to use the mysql extension to connect to the DB.
2. I download Media Wiki from Media Wiki directly and does not detect the mysql extension either.

Offline

#14 2012-03-01 20:08:53

rolfijn
Member
Registered: 2010-02-05
Posts: 17

Re: Mediawiki - PHP - MySQL: Could not find a suitable database driver!

Had the same problem. The installation only offered me sqlite in my case. I have sqlite support enable in my php.ini, as well as mysql and mysqli. After I did a "Restart installation" from the mediawiki installation screen and got back to the "connect to database" screen it did offer me connect to a MySQL database (but not sqlite anymore...huh?).

Offline

#15 2012-03-03 23:45:07

HalfEmptyHero
Member
Registered: 2011-10-20
Posts: 16

Re: Mediawiki - PHP - MySQL: Could not find a suitable database driver!

rolfijn wrote:

Had the same problem. The installation only offered me sqlite in my case. I have sqlite support enable in my php.ini, as well as mysql and mysqli. After I did a "Restart installation" from the mediawiki installation screen and got back to the "connect to database" screen it did offer me connect to a MySQL database (but not sqlite anymore...huh?).

I had the exact opposite. I wanted SQLite, but only MySQL showed up, even though I can use SQLite with other php projects.

Offline

#16 2012-03-10 05:43:29

kctang
Member
Registered: 2012-02-14
Posts: 1

Re: Mediawiki - PHP - MySQL: Could not find a suitable database driver!

I got the same "MySQL: Could not find a suitable database driver!" error message while setting up Mediawiki on my user's public_html directory. The message went away (and I'm able to install) when i moved Mediawiki to /srv/http.

This is likely some kind of permission thing, but I did not investigate. Just sharing this information in case others find it useful.

Offline

#17 2012-06-13 05:18:31

jes5199
Member
Registered: 2012-06-13
Posts: 1

Re: Mediawiki - PHP - MySQL: Could not find a suitable database driver!

The trick for me was clicking  "Restart installation" in the MediaWiki installer - apparently it cached the fact that it couldn't fine the MySQL driver (!!!) and didn't notice that I had fixed the problem.

Offline

#18 2012-06-14 19:53:21

crouthamela
Member
Registered: 2012-06-14
Posts: 1

Re: Mediawiki - PHP - MySQL: Could not find a suitable database driver!

After working on this for several hours it appears the answer is available at: http://www.mediawiki.org/wiki/Manual:SQ … stallation

Specifically:

"
Since PHP 5.1.0, SQLite depends on PDO. You should uncomment the following two lines in your php.ini (note: sometimes you can't even use phpinfo() to check if they are present, because an SQLite-enabled PHP tend to crash or fail when PDO is absent, especially on Windows):

    extension=php_pdo_sqlite.so (or extension=php_pdo_sqlite.dll for Windows)
    extension=php_pdo.so (or extension=php_pdo.dll for Windows)
"

Once I un-commented those and restarted php-fpm, the MediaWiki installation now offers SQLite as a database option.

Offline

#19 2013-12-09 10:00:16

kayaman
Member
Registered: 2012-09-03
Posts: 11

Re: Mediawiki - PHP - MySQL: Could not find a suitable database driver!

hi,

well i got the same Problem as explained in the title. Since [1] says: Warning: As of PHP 5.5, mysql.so is deprecated and will fill up your log files. I didn't load it at the beginning. Still mediawiki needs it, so i added it in php.ini and now i can install the wiki. Btw i am using MariaDB.


[1] https://wiki.archlinux.org/index.php/LAMP

Offline

Board footer

Powered by FluxBB