These forums are locked and archived, but all topics have been migrated to the new forum. You can search for this topic on the new forum: Search for VM GPL missing mysql connection in php5... on the new forum.
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?
found solution:
apt-get install php5-mysql
beats me why VM GPL did not include this!
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 :)