View Full Version : php+mysql "undefined function mysql_connect()"

March 30th, 2007, 09:39 AM
Hi everyone, I'm a new user to this Furum.

I have that error message:

"Fatal error: Call to undefined function mysql_connect() in /var/www/cjbTest/myConnect.php on line 16"

line 16: mysql_connect('host', 'uName', 'pw') or die(mysql_error());
line 17: mysql_select_db(dbName) or die(mysql_error());

I did check the php.ini file and uncomment:

But I do not know the location of mysql.so. And if I don't have the file (mysql.so), where can I download it?


March 30th, 2007, 10:56 AM
You need to install the package mysql-server

March 30th, 2007, 12:05 PM
this is probably possible to do using the package manager directly, but i'm too lazy to bother figuring that out now .. so

* http://packages.ubuntu.com/
* http://packages.ubuntu.com/cgi-bin/search_contents.pl?word=mysql.so&searchmode=searchfiles&case=insensitive&version=edgy&arch=i386
..leading too..
* http://packages.ubuntu.com/edgy/web/php5-mysql

..as the most likely candidate i think.. so then you do:

sudo aptitude install php5-mysql

never ever(#1) "download" stuff when working in Linux; use the package manager of the distro you are using!

#1: there are some exceptions to this, but you better be damn sure you have a rationale for doing something like that.

March 31st, 2007, 06:19 AM
I would like to thank you both Monk-e and Inostdal. Now, everything works very well. BIG Thank you again for helping me; you are the best!!!

:) ):P