VM GPL missing mysql connection in php5...

  • jmedia
  • 06/11/08
  • Offline
Posted: Fri, 2008-06-13 01:55

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?


Re:VM GPL missing mysql connection in php5...

  • jmedia
  • 06/11/08
  • Offline
  • Fri, 2008-06-13 02:01

found solution: apt-get install php5-mysql

beats me why VM GPL did not include this!


Re:VM GPL missing mysql connection in php5...

  • beat
  • 07/12/08
  • Offline
  • Thu, 2008-07-17 10:55

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:

/usr/lib/php5/20060613+lfs

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 :)