Topic on Project:Support desk

[RESOLVED] Fatal error update to Mediawiki 1.23: DatabaseBase: factory no viable database extension found for type 'mysql'

14
2.224.75.22 (talkcontribs)

Hi can you help me? I have this error when call the script for Update from the new directory of mediawiki/opt/unbit/php555/bin/php maintenance/update.php [no req] Exception from line 851 of includes/db/Database.php DatabaseBase::factory no viable database extension found for type 'mysql'

but I verified taht the Mysql is supported because with a test php info file I see PHP Version 5.4.19

mysql

MySQL Support	enabled
Client API version	5.5.9
...
2.224.75.22 (talkcontribs)

Anyone can help me?

I also tried with recall php.ini file opt/unbit/php555/bin/php maintenance/update.php - c ../php.ini il file php.ini that is my folder server whit this instruction

magic_quotes_gpc = Off
date.timezone = Europe/Rome
session.save_path = /accounts/www/sessionpath
extension = curl.so
extension = gd.so
extension = mysql.so
extension = mysqli.so

But the error is the same

Ciencia Al Poder (talkcontribs)

try executing php, without specifying the update.php script, but with the -i argument. It should display information about the loaded extensions. Look there to see if mysql or mysqli are installed. Maybe if mysql.so doesn't exists, it will ignore it even if you specify it.

In your posts I see you used php - c but it should be php -c without spaces.

2.224.75.22 (talkcontribs)

I tried call opt/unbit/php555/bin/php maintenance/update.php -c ../php.ini without space: same error. This is the result with invocation of php -i

phpinfo() PHP Version => 5.2.17

... Configure Command => './configure' '--prefix=/opt/unbit/php5217' '--with-kerberos' '--disable-ipv6' '--with-curl=shared' '--with-gd=shared' '--enable-mbstring' '--with-mysql=shared,/opt/unbit/mysql5523/' '--with-mysqli=shared,/opt/unbit/mysql5523/bin/mysql_config' '--with-zlib' '--with-mcrypt=shared' '--with-mhash=shared' '--enable-soap' '--with-pdo-mysql=shared,/opt/unbit/mysql5523/' '--with-pdo-pgsql=shared' '--with-pdo-sqlite=shared' '--with-pgsql=shared' '--with-openssl' '--with-imap=shared' '--with-jpeg-dir' '--enable-fastcgi' '--with-bz2' '--enable-calendar' '--enable-exif' '--with-imap-ssl' '--with-ldap=shared' '--enable-mbstring' '--enable-sockets' '--enable-sqlite-utf8' '--enable-zip' '--with-xsl=shared' '--with-snmp=shared' '--with-sqlite=shared' '--with-xmlrpc=shared' '--with-tidy=shared' '--with-freetype-dir=/usr/lib' '--with-mysql-sock=/var/run/mysqld/mysqld.sock' '--with-gettext' '--enable-embed' Server API => Command Line Interface

The list of activated PHP extensions does not list mysql, mysqli or alike.

88.130.121.191 (talkcontribs)

Hi!

Accessing your webserver with a browser and with a shell are two different things. When you access your webserver with a browser, you can see one PHP version, while on the shell you see another one.

In your case the command "php" executes PHP 5.2. This version is not compatible with MediaWiki 1.23. Solution: Execute the updater with PHP 5.3 or newer. All you need to know is the command to execute PHP 5.3 or newer on the shell. It might be (only guessing) php5 or php53. So try

php5 maintenance/update.php

or

php53 maintenance/update.php

to run the updater. However, what this command is depends on how your host configured the server - ask him!

A bit off-topic: Why does the questioner not get a helpful error message like "You are using PHP version x.y.z but MediaWiki needs PHP 5.3.2 or higher."? That message was what people got in the past - is that broken now?

Florianschmidtwelzow (talkcontribs)

> A bit off-topic: Why does the questioner not get a helpful error message like "You are using PHP version x.y.z but MediaWiki needs PHP 5.3.2 or higher."? That message was what people got in the past - is that broken now?


If te code not lies, there is still a PHP version error message in update script:

https://github.com/wikimedia/mediawiki-core/blob/master/maintenance/update.php

So, i think it's a host configuration problem in some tricky way :)

88.130.121.191 (talkcontribs)

> So, i think it's a host configuration problem in some tricky way :)

I have checked with the PHP manual: version_compare() should be present with 5.2 and the way it is used in the code - according to the manual - is correct. The code of 1.23 is identical to the code of master, which you linked. To me it is not understandable, how this problem here can arise...

2.224.75.22 (talkcontribs)

The server say that I can call the bin of php that are on server in the folder /opt/unbit/ there are many folder (version) of php for example there is php555 folder so when I tried call from the new folder of wiki /opt/unbit/php555/bin/php maintenance/update.php -c php.ini or also without php.ini I have the ERROR

88.130.121.191 (talkcontribs)

I fully understand. However, /opt/unbit/php555/bin/php is an old version of PHP. Don't use it! It does not work with MediaWiki 1.23. Use another one!

2.224.75.22 (talkcontribs)

Ok now is o and I updated the wiki to 1.23. The correct command is /opt/unbit/php555/bin/php -c ~/www/php.ini maintenance/update.php

In php.ini file I have this istructions magic_quotes_gpc = Off date.timezone = Europe/Rome session.save_path = /accounts/www/sessionpath extension = curl.so extension = gd.so extension = mysql.so extension = mysqli.so

Anyway is very strage because the last year I updated at 1.21 without give php.ini to the command, but only with /opt/unbit/php555/bin/php maintenance/update.php so I think that the the error is not generate by the version of php but for the incorrect invocation of my php.ini that now is useful for update the wiki.

Thank you for the support!

88.130.121.191 (talkcontribs)

Why you do not get a version error while phpinfo says you would use PHP 5.2.17 is strange and not understandable to me.

However, if this works for you, then do it that way. ;-)

Florianschmidtwelzow (talkcontribs)

I have tested it with a windows xampp 1.7.1 (which has php 5.2.9 on board) and i got the php version error with maintenance/update.php and with the webinstaller (both with MW 1.24) :/

88.130.73.56 (talkcontribs)

Honestly that is what I expected. ;-) Something must be broken in that PHP installation: Old version number, but version number check not working correctly, the 5.2 install in a folder, where the name makes you think it would be 5.5 and then this strange behaviour; maybe it is also the MediaWiki installation, which is broken. All this is not normal. However, good to know that this behaviour is not reproducable and so - given these circumstances - most likely not a bug in MediaWiki.

Thanks for investigating!

Tuxun (talkcontribs)

I personnaly had this problem one hour ago, and what I did forget to install was php-mdb2-driver-mysql because I use mariadb. One may need php-mysql only if he use a mysql database, but I think remember that mariadb is what is recommanded at the moment. Thanks to your comment, for helping me to figure out that i had a missing componant in my php install :)

Reply to "[RESOLVED] Fatal error update to Mediawiki 1.23: DatabaseBase: factory no viable database extension found for type 'mysql'"