Problems with PHP and MYSQL

3 posts / 0 new
Last post
#1 Sun, 03/21/2010 - 10:04
CadillacRick

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 "extension=mysql.so" line in the php.ini file, and i've pointed the "extension_dir = " to /usr/lib/perl5/auto/DBD/mysql/ which is where the "mysql.so" 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 !!

Sun, 03/21/2010 - 10:39
andreychek

Hrm, it's possible that you're pointing it at the wrong mysql.so file :-)

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.

-Eric

Sun, 03/21/2010 - 14:17 (Reply to #2)
CadillacRick

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

Thanks again!

Rick

Topic locked