This is probably some basic setting that I am missing, so please forgive my ignorance. I have spent the last hour trying to figure this out.

I am running:

Win XP
Apache 2.2.4
PHP 5
Mysql 5.0

I get the following when I try to bring up install.php:

"Your web server does not appear to support any common database types. Check with your hosting provider to see if they offer any databases that Drupal supports."

So, I figure that my PHP settings are off. I ensured that extension=php_mysql.dll and extension=php_mysqli.dll are uncommented in php.ini

Also, I moved the libmysql.dll into my system directory. Bounced Apache. I still get the same.

Also, I get the following if I try to open a basic index.php on the httpdocs folder that I put some mysql test code in:

"Fatal error: Call to undefined function mysql_connect() in C:\Program Files\Apache Software Foundation\Apache2.2\htdocs\index.php on line 14"

Any thoughts? Do I need to add something to my Apache config?

I'm stumped.

Thanks,
Ted

Comments

cburschka’s picture

To find out if PHP is built with MySQL support, make a .php file that prints the PHP build info:


phpinfo();

Under the section "configure commands", there should be something like

--with-mysql=...

If there isn't, MySQL support is disabled - though I can't exactly say what caused it or how you can fix it...

tedhogan’s picture

Thanks for the idea.

Nope, it's not there.

Do I need to add something to Apache in order to get mysql to talk to it? I'm trying to google this, but I'm not having any luck... too much garbage (wamp, etc.) sites getting in the way...

Ted

tedhogan’s picture

OK, I discovered my mistake.

I re-installed apache and php. Evidently the first php install did not correctly modify the apache config file. At least... I think...

It all works now.

Thanks,
Ted

rptrevor’s picture

What was the mistake you discovered?

I've re-installed PHP 5.2 several times. I've added the mysql and mysqli extensions, but still no luck...

Thanks,

Rich

vinhboy’s picture

Had the same problem. Took me all day to figure it out. Then I restarted apache and it works!

jack_blee’s picture

same for me, an apache restart was all i needed.

rmanola’s picture

As was having the same problem, restarted apache and everything worked fine.

TreyeDesigns’s picture

I was having the same errors as the original post when I upgraded from php 4 to php 5. I restarted Apache and everything seems to be working.

gorilla_ch’s picture

I got the same error message and the same install packages as in the #1 post.

Now I got the problem fixed by installing the MySQL extension in PHP. By default the extension is not included. You can install it by re-running the PHP installer and change to include the extension.

Hope this help,

yersin’s picture

Thank you. That worked for me. I re-ran my php installer and chose change to add the mysql extension. I hope it helps others.

- yhh -

David Xie’s picture

Thanks, that also worked for me.

sisyphos’s picture

I have the same problem, but still no solution.
How has an apache config file to be correct?
I don't know what to do...

attila75’s picture

When I installed drupal to my Windows computer, I've got some problem, and but I am not sure if it was this problem or not. I have come to the conclusion that somehow my system could not find libmySQL.dll. You can read more about it at:

http://php.net/mysqli

***
Installation on Windows Systems

MySQLi is not enabled by default, so the php_mysqli.dll DLL must be enabled inside of php.ini. Also, PHP needs access to the MySQL client library. A file named libmysql.dll is included in the Windows PHP distribution and in order for PHP to talk to MySQL this file needs to be available to the Windows systems PATH. See the FAQ titled "How do I add my PHP directory to the PATH on Windows" for information on how to do this. Although copying libmysql.dll to the Windows system directory also works (because the system directory is by default in the system's PATH), it's not recommended.

As with enabling any PHP extension (such as php_mysqli.dll), the PHP directive extension_dir should be set to the directory where the PHP extensions are located. See also the Manual Windows Installation Instructions. An example extension_dir value for PHP 5 is c:\php\ext

Note: If when starting the web server an error similar to the following occurs: "Unable to load dynamic library './php_mysqli.dll'", this is because php_mysqli.dll and/or libmysql.dll cannot be found by the system.
***

Although the above documentation does not recommend it, I could only make things work by copying the libmySQL.dll from the mySQL bin directory to the Windows System32 directory.

Now that one of my colleagues also installed drupal, we tried this "trick" and it solved the error discussed in this thread. So I hope this helps.

gonefishing’s picture

dharmeshmac’s picture

Hi,

Based on attilla75's help above it works for me when i copied libmysql.dll file from C:\program files\php folder to c:\windows folder.

Thanks

Devis’s picture

I had a similar problem with PHP5+MYSQL5+APACHE2 on a Windows XP server.

Be sure to include the PHP folder in the system PATH and to reboot the system after installing the software.

In my case everything went right just rebooting the server.

HiTekJeff’s picture

I have done everything described above and mine still won't work.

I have the same config as the first post above and have even tried to copy the files people have said to the Windows or Windows/system32 directories and still no luck. Seems to me the install script for Drupal is lacking or there is a flaw somewhere. You shouldn't have to jump through hoops like this, especially since I can run other software that requires PHP/MySQL on my localhost without issues.

Yes, I have verified my installs of MySQL, PHP, Apache as working. I CAN get a basic PHP script to display in my browser just fine using localhost and went though the "php.ini" file as mentioned above to adjust it. Just not sure why it's not connecting to database or the error as described in this topic is coming from.

Any thoughts since I've tried the above.

youssefmamdouh’s picture

hey guys,
i tried to solve this for me as nothing posted here was working with me, god only knows why :).
but i found the problem at last and i made a post about it.
you can check it
http://fci-h.blogspot.com/2007/08/installing-drupal-with-php-52-apache22...

hope this become useful

Code Hitmen’s picture

Another possible cause of the message is described here:

http://bugs.php.net/bug.php?id=43913

Apparently in some of the released builds of PHP, configuration files were not being properly read (at least on Windows Server 2003). Switching to the current snapshot build of PHP fixed the problem for me.

Wazzz’s picture

Hey All... I had this problem & tracked it down to the PHP Environment Variable in XP... I had PHP installed previously, & this install didn't have MySQL enabled, so I got the 'No Db' error... I changed the Path in System > Advanced > Environment Variables > System Variables > PHPRC to point at the Xampp php.ini, did a restart, all well & good... ;-)

The Xampp php.ini is all setup & ready to go, so pointing Windoze at it did the trick...

Hope this helps!!!

a.p’s picture

All,

I got into same issue.

Had to change following to get it working:

1. C:\Program Files\php\php.ini
Change extension_dir="./" to extension_dir = ".\ext"

Uncomment following
extension=php_mysql.dll
extension=php_mysqli.dll

2. System> Advanced > Environment Variables >
edit PATH to add C:\Program Files\php

The above directory has libmysql.dll file, which is required to load the mysql.

I rebooted the system and the error went off.. probably, I could've just restarted Apache.

Cheers,
Prasanna

Johnywoo’s picture

Sorry to raise this topic from the dead however I have come across a similar issue but not using Mysql rather Postgres. To set this up I am using Apache 2.0; Postgres 8.3; Drupal 6.8 and PHP 5.2.8.

When I run the install I choose to include the Postgres extension so that it includes a php_pgsql.dll file in the ext directory and adds '[PHP_PGSQL] extension=php_pgsql.dll' into the php.ini conf file.

When I restart the server I get the same notification that others received in "Your web server does not appear to support any common database types." Now if I included the php_mysql.dll file as well, that problem goes away so I am assuming it has to do with the dll file offered for postgres. There is a report that I have to use the php_pgsql.dll verson 5.2.5 but am not sure if that is the case for the versions I am currently using.

Any information would be helpful, thank you.

abdu’s picture

I got the same problen when installing drupal 7 dev
I removed the comment in my php.ini for
extension=php_pdo_mysql.dll

Now it's working

Jeff Burnz’s picture

Ironically I had to the opposite when installing D7 on a build of Uniform server, un-commenting extension=php_pdo_mysql.dll got things working :)

jeremyraybrown’s picture

I saw the same error message.

My install was on window's vista and occurred in the following order:

1. apache 2.2.13
2. php 5.2.10 with all extension
3. mysql 5.1.38 (64-bit version)
4. drupal 6.1.3

I encountered the same error and tried the restart option with the Apache monitor. That didn't seem to do the trick. So, I did a stop, then a start with the apache monitor and it worked. Perhaps investing what is at the following URL will shed some light:

http://issues.apache.org/jira/browse/GERONIMO-4794

You can use php.info() on a test page to determine if the Apache Environment has a path to your MySQL bin. If it does then a hard stop and start is all that is needed.

nickleeson’s picture

Followed all instructions above. Copied the file to Windows/system dir too. Rebooted. Worked fine!

amagdy’s picture

Remove both Apache & PHP from your machine, then reinstall them
make sure that they are removed totally from your system by checking that localhost is down

P.S. you have to restart apache at the end of your removal

Abdelrahman

beruhh’s picture

I installed Apache 2.2.16, PHP 5.3, and mysql 5.1 on a Windows XP SP2 machine to setup drupal-6.19 and the final configuration to enable mysql support and get php to connect to it was sort of a hassle. The issue of the above error, (Your web server does not appear to support any common database types) seems to be related to the php configuration, and how it connects to the database. Specifically, the path of the php.ini configuration file. When using phpinfo(), on the 6th row, the Configuration file (php.ini) path remained C:\WINDOWS and it didn't load the c:\php\php.ini file I had indicated. It was also clear that mysql support was not enabled. I think it makes a difference not only if the path for the php.ini file is inaccurate in httpd.conf but also if there are other php.ini files, either in c:\Windows or c:\Program Files\PHP. This occurs if you have installed and uninstalled php multiple times, using different versions of both the .zip and the msi downloads (as I did).

In older versions, if the necessary extensions have been uncommented (php_gd2.dll, php_mysql.dll, php_mysql.dll, php_mbstring.dll, php_mcrypt.dll, php_pdo_mysql.dll) and the path of extension_dir = "c:\[php_dir]\ext" has been updated, there should be no need for copying the dlls to the [Winroot_dir]\ or other WINDOWS\system32 locations. As long as the environment variables have been edited to include the ;c:\php directory, where the only configured php.ini file should be located.

And finally, if you download the php-5.3.3-Win32-VC6-x86 installer, (w/ open SSL support) and in my case, I changed the default installation path to c:\php (if it's not there, simply create the folder), you can configure the extensions during installation, and there are no additional edits required, although you have to specify the doc_root, as well as the extension_dir as per your setup. Finally, reboot your system and it should be good to go... Thanks for all your inputs guys; couldn't have figured it out otherwise.

hamzah.qawasmi’s picture

be sure u have php5-mysql
dpkg --list | grep php5-mysql
if u dont
# apt-get install php5-mysql
then restart the apache

oren102’s picture

You would be surprised how many people forget to install this... This is most likely the problem and should have been in one of the first posts :)