View Issue Details

IDProjectCategoryView StatusLast Update
0023466mantisbtdb mysqlpublic2017-12-04 02:17
ReporterCRCinAUAssigned Toatrol 
PrioritynormalSeverityminorReproducibilityalways
Status closedResolutionfixed 
Product Version2.7.0 
Target Version2.9.0Fixed in Version2.9.0 
Summary0023466: database is not supported by PHP. Check that it has been compiled into your server.
Description

When upgrading from 2.6.0 -> 2.7.0, I now get a fatal error page when loading the main index.php:

APPLICATION ERROR #400
Database connection failed. Error received from database was #0: PHP Support for database is not enabled.

If I look at the admin/install.php page, I see:
Checking PHP support for database type BAD
database is not supported by PHP. Check that it has been compiled into your server.
Checking PHP support for MySQL driver BAD
mysql driver is deprecated as of PHP 5.5.0, and has been removed as of PHP 7.0.0. The driver is no longer supported by MantisBT, please use mysqli instead

Version 2.6.0 works perfectly in this environment. Version 2.7.0 does not.

Enviroment is EL7 with Remi's PHP 7.0 packages:
$ rpm -qa | grep remi | sort
gd-last-2.2.5-1.el7.remi.x86_64
libzip5-1.3.0-1.el7.remi.x86_64
libzip-last-1.1.3-1.el7.remi.x86_64
php-7.0.24-1.el7.remi.x86_64
php-cli-7.0.24-1.el7.remi.x86_64
php-common-7.0.24-1.el7.remi.x86_64
php-gd-7.0.24-1.el7.remi.x86_64
php-intl-7.0.24-1.el7.remi.x86_64
php-json-7.0.24-1.el7.remi.x86_64
php-mbstring-7.0.24-1.el7.remi.x86_64
php-mysqlnd-7.0.24-1.el7.remi.x86_64
php-opcache-7.0.24-1.el7.remi.x86_64
php-pdo-7.0.24-1.el7.remi.x86_64
php-pecl-apcu-5.1.8-1.el7.remi.7.0.x86_64
php-pecl-apcu-bc-1.0.3-1.el7.remi.7.0.x86_64
php-pecl-memcache-3.0.9-0.9.20170802.e702b5f.el7.remi.7.0.x86_64
php-pecl-mysql-1.0.0-0.9.20151007git294ce3b.el7.remi.7.0.x86_64
php-pecl-zip-1.15.1-1.el7.remi.7.0.x86_64
php-process-7.0.24-1.el7.remi.x86_64
php-xml-7.0.24-1.el7.remi.x86_64
remi-release-7.3-2.el7.remi.noarch

TagsNo tags attached.

Relationships

related to 0023381 closedatrol Unneeded code for unsupported PHP versions 

Activities

CRCinAU

CRCinAU

2017-10-12 10:52

reporter   ~0057946

Ah - it turns out that I still had:
$g_db_type = 'mysql';

It didn't occur to me that this needed to be changed to mysqli.

Can I please suggest that the error message displayed be enhanced in two ways:
1) Tell you that you have the config option 'mysql' specified.
2) Test if mysqli is available, and if so - suggest changing mysql -> mysqli in the config file

or;
If mysql is specified, but mysqli is available, automatically switch to mysqli.

atrol

atrol

2017-10-12 10:55

developer   ~0057947

Last edited: 2017-10-12 10:57

View 3 revisions

mysql driver is deprecated as of PHP 5.5.0, and has been removed as of PHP 7.0.0. The driver is no longer supported by MantisBT, please use mysqli instead

Did you check if $g_db_type is set to mysql?
If so, change it to mysqli.

[Edit] Didn't read your latest note before writing my note.

atrol

atrol

2017-10-31 12:48

developer   ~0058093

PR https://github.com/mantisbt/mantisbt/pull/1225

I added an additional check to distinguish between non supported databases and databases that are not enabled in PHP.

vboctor

vboctor

2017-10-31 13:15

manager   ~0058094

@atrol should we have our code map mysql to mysqli?

atrol

atrol

2017-10-31 13:47

developer   ~0058095

@vboctor I prefer to keep it as simple as possible.
There are already mappings that don't work,
e.g. function db_get_type does support types postgres and postgres7 whereas db_check_database_support does not support those types.
My plan was to have some more cleanup of the types after this PR.

atrol

atrol

2017-11-01 12:36

developer   ~0058108

My plan was to have some more cleanup of the types after this PR.

Opened 0023572 for it.

Related Changesets

MantisBT: master 4738e13a

2017-10-31 12:35:28

atrol

Details Diff
Enhance error handling for unsupported database types

Fixes 0023466
mod - core/database_api.php Diff File

Issue History

Date Modified Username Field Change
2017-10-12 10:30 CRCinAU New Issue
2017-10-12 10:52 CRCinAU Note Added: 0057946
2017-10-12 10:55 atrol Status new => feedback
2017-10-12 10:55 atrol Note Added: 0057947
2017-10-12 10:57 atrol Note Edited: 0057947 View Revisions
2017-10-12 10:57 atrol Note Edited: 0057947 View Revisions
2017-10-12 11:06 atrol Priority urgent => normal
2017-10-12 11:06 atrol Severity crash => minor
2017-10-12 11:06 atrol Target Version => 2.8.0
2017-10-12 11:06 atrol Assigned To => atrol
2017-10-12 11:06 atrol Status feedback => assigned
2017-10-12 11:10 atrol Relationship added related to 0023381
2017-10-28 19:14 vboctor Target Version 2.8.0 => 2.9.0
2017-10-31 12:48 atrol Note Added: 0058093
2017-10-31 13:15 vboctor Note Added: 0058094
2017-10-31 13:47 atrol Note Added: 0058095
2017-10-31 18:41 atrol Changeset attached => MantisBT master 4738e13a
2017-10-31 18:41 atrol Status assigned => resolved
2017-10-31 18:41 atrol Resolution open => fixed
2017-10-31 18:41 atrol Fixed in Version => 2.9.0
2017-11-01 12:36 atrol Note Added: 0058108
2017-12-04 02:17 vboctor Status resolved => closed