VM GPL missing mysql connection in php5...

3 posts / 0 new
Last post
#1 Fri, 06/13/2008 - 02:55

VM GPL missing mysql connection in php5...

i get the message "Call to undefined function mysql_connect()" when trying to call the db from php.

mysql is installed and database was imported from sql. user and pw is correct.

have edited /etc/php5/apache2/php.ini to have extension=mysql.so

any ideas?

Fri, 06/13/2008 - 03:01

found solution:
apt-get install php5-mysql

beats me why VM GPL did not include this!

Thu, 07/17/2008 - 11:55 (Reply to #2)

That wasn't enough for my setup using Virtualmin Pro that we just purchased.

Problem is that debian installs the .so libs into a sub-folder:


so I spent some hours trying to find why it didn't load MySQL extension in php5 !

I added directive to /etc/php5/apache2/php.ini (using in apache 2 mode):

extension_dir = "/usr/lib/php5"

wrongly supposing that PHP would scan subdirectories as well...

In fact I had to add:

extension_dir = "/usr/lib/php5/20060613+lfs"

As most PHP programs use MySQL, including those in the installer scripts I'm voting to apt-get install the php5-mysql lib during virtualmin pro installation, but more importantly to correctly configure the extension_dir to the right path.

Hope the above will be useful to others and that it was the correct way to do. At least it works.

Feel free to tell a better way :)

Topic locked