Problems with PHP and MYSQL

Hey guys, i’m having some problems with PHP and MYSQL

I have virtualmin 3.76 installed on my Ubuntu Linux 8.04 LTS server, and I can’t seem to get MySQL to register with PHP. When i check the phpinfo() there is no table with MySQL listed…

I’ve uncommented the “” line in the php.ini file, and i’ve pointed the "extension_dir = " to /usr/lib/perl5/auto/DBD/mysql/ which is where the “” file is located on my machine after the automated install by virtualmin… and I just can’t seem to get it to work…

whenever i run a .php file that tries to access the MySQL server i get this

Fatal error: Call to undefined function mysql_connect()

Any ideas on what i’m doing wrong ??? Any help would be greatly appreciated !!

Hrm, it’s possible that you’re pointing it at the wrong file :slight_smile:

It sound like the dir you have it pointing to is for Perl, whereas you need the PHP MySQL module.

By default, Virtualmin doesn’t install all the PHP modules, including the one for MySQL. I suspect the issue is simply that you may need to install it, with “apt-get install php5-mysql”.

After that, if you comment out the extension_dir setting, try looking at the phpinfo settings again, you should see MySQL mentioned in there now.


Thanks Eric, i did exactly what you suggested and the “mysql” box now appears in the phpinfo() in the web browser!

Thanks again!