0

I get this rather weird problem while I try to install Drupal 6.22. The web server is nginx+ php5-fpm which I've used with great success before and according to the Ubuntu package manager, php5-mysql is already the newest version (however it does not appear in phpinfo() page). The configuration page is in /etc/php5/fpm/php.ini. Here is the error message:

In your ./sites/default/settings.php file you have configured Drupal to use a mysql server, however your PHP installation currently does not support this database type.

I have created the database and permission.The database declaration line in settings.php seem to be correct.

How can I enable MySQL support and solve this problem?

4 Answers 4

1

" (However it does not appear in phpinfo() page)".

If it is not listed there, then it is not enabled.

Ubuntu usually creates a /etc/php5/conf.d/extension.ini file for each extension package, make sure that exists and contains a line like "extension=mysql.so".

2
  • In fact the extension.ini did not exist, so I created it in /etc/php5/fpm/conf.d and added 'extension=mysql.so' to it. After restarting php5-fpm, the problem is gone. You're the man Berdir, cheers!
    – alfish
    Jun 2, 2011 at 11:04
  • Note that I meant name_of_the_extension.ini (e.g. mysql.ini), but as long as it works... :)
    – Berdir
    Jun 2, 2011 at 11:21
0

I believe Drupal uses MySQLi to establish the database connection. You could try installing the php5-mysqli package if MySQLi is not supported by default.

2
  • 1
    Drupal supports both extensions.
    – Berdir
    Jun 1, 2011 at 23:51
  • E: Package 'php5-mysqli' has no installation candidate
    – alfish
    Jun 2, 2011 at 10:58
0

I always advice new users to install phpmyadmin package. That will install, as a dependency, all the packages you need to properly run drupal. As you're running with nginx, you'll have to install it later.

Also, you can install drupal from ubuntu's repository

2
  • In my view, both are bad practices, even for newbies. phpmyadmin is the waste of memory and installing drupal from Ubuntu repos is accepting the delay to update packages to reach new releases.
    – alfish
    Jun 2, 2011 at 11:09
  • I agree. It's not recommended at all, but if you're in a hurry and in a testing environment, I don't think it's too bad. Jun 2, 2011 at 23:27
0

Drupal's config.php file should have:

$db_url = 'mysql://db_username:db_password@localhost/database_name';

OR

$db_url = 'mysqli://db_username:db_password@localhost/database_name';

MySQL should be already running.

php.ini should have:

extension=php_mysql.dll

AND/OR

extension=php_mysqli.dll
2
  • I guess you are talking about Windows. I said farewell to that a long time ago :)
    – alfish
    Jun 2, 2011 at 11:06
  • 1
    alfish, You can replace "php_mysql(i).dll" with "php_mysql(i).so" in the above and now it's about Linux.
    – rightstuff
    Jun 2, 2011 at 13:46

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .