My system: PHP 5.2.0, extension only mysqli.
When not install CMS (just copy files) index page show warning "PHP MySQL support not enabled".

Solution: add verification mysqli_* function and edit "\includes\database.mysql.inc" row 57 like this:

if (!function_exists('mysql_connect') && !function_exists('mysqli_connect')) {

CommentFileSizeAuthor
#9 mysql_db_check.patch1.33 KBasimmonds
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Uwe Hermann’s picture

Can you reproduce this on a more recent Drupal version? Does it prevent you from installing Drupal or is it merely a warning? In the first case this would be a critical issue, IMHO.

4matic’s picture

Version: 5.0-beta2 » 5.0
Priority: Minor » Critical

Download last version . Same problem. I cant install Drupal because have only warning:

PHP MySQL support not enabled

We were unable to use the MySQL database because the MySQL extension for PHP is not installed. Check your PHP.ini to see how you can enable it.

For more help, see the Installation and upgrading handbook. If you are unsure what these terms mean you should probably contact your hosting provider.

Niether forms nor links that propose install Drupal.
Change status to critical.

4matic’s picture

My solution is stupid in first post.

Uwe Hermann’s picture

Confirmed in 5.0. To reproduce, remove extension=mysql.so from your PHP config file and restart Apache. Then try to install Drupal 5.0. It will fail with the above mentioned error.

This is indeed critical IMHO.

Uwe Hermann’s picture

Title: mysqli not recognized » Installer doesn't work if only mysqli is available but not mysql
moshe weitzman’s picture

does anyone's php ship without mysql extension? if not, i think we can downgrade this.

chx’s picture

I would dare to say that most Unix/Linux distributions ship without almost any PHP extension per default. Think of the FreeBSD (or was it NetBSD?) where the system comes without PCRE which is enabled in the normal PHP distribution but not there.

4matic’s picture

I disabled all unnecessary extensions on my server. Server is more faster and stable. mysql extention is deadend extention IMHO.

asimmonds’s picture

Status: Active » Needs review
FileSize
1.33 KB

The problem here is that Drupal is trying to connect to the database with the default $db_url, and if the
mysql module doesn't exist, then the redirect to ./install.php is not produced.
This only happens if ./index.php is called first, going directly to ./install.php works correctly.

If a debug_print_backtrace() is placed where this error is generated in database.mysql.inc/db_connect(), we get:

#0  db_connect(mysql://username:password@localhost/databasename) called at [./includes/database.inc:128]
#1  db_set_active() called at [./includes/bootstrap.inc:792]
#2  _drupal_bootstrap(2) called at [./includes/bootstrap.inc:767]
#3  drupal_bootstrap(7) called at [./index.php:13]

Patch attached that adds a redirect to ./install.php if mysql module doesn't exist and
the database credentials are the defaults.
The redirect code is a exact copy of what is used further down in db_connect() if
the database connection fails. Suppose it could be made into a small private function...

Steven’s picture

Status: Needs review » Fixed

Good catch. Committed to HEAD and 5.0.

Anonymous’s picture

Status: Fixed » Closed (fixed)