Jump to content


Photo

Call to undefined function: mysql_connect()


  • Please log in to reply
7 replies to this topic

#1 rolling_titan

rolling_titan
  • New Members
  • Pip
  • Newbie
  • 3 posts
  • LocationPune,India

Posted 21 October 2003 - 10:10 AM

Hello all,
I have on RH-9 installed apache server, mysql and PHP.
I could view the test page via the browser, hence Apache is installed correctly.
I could create databases / tables, hence mysql is working fine.
Using the vi editor i could create a sample .php file and saved it in the default document root \"/var/www/html\".
I could view this file, but when i add a database connection using mysql_connect i get the following error :Call to undefined function: mysql_connect().
In php.ini file i have left the
default_port blank.
default_socket as /var/lib/mysql/mysql.sock
default_host as the server name where LAMP is installed
default_user as root
default_password as blank.
my syntax for db connection is :mysql_connect(\"servername\",\"root\",\"\");

httpd version :httpd-2.0.40-21.5
mysql :MySQL-3.23.51-1
php :php-4.2.2-17.2
php-mysql :php-mysql-4.2.2-17.2

#2 shivabharat

shivabharat
  • Members
  • PipPipPip
  • Advanced Member
  • 371 posts
  • LocationChennai, India

Posted 21 October 2003 - 11:20 AM

I am not sure if PHP 4.2 has mysql function inbulit. You can either try to upgrade or try to edit the php.ini file.

You may see mysql library file name in the extension just uncomment the line and see if it helps.
Knowledge --- Reading Enriches Mind But Sharing Enhances It.[br][br]Note: Before you request help enusre that you have had a look at the tutorials @phpfreaks

#3 rolling_titan

rolling_titan
  • New Members
  • Pip
  • Newbie
  • 3 posts
  • LocationPune,India

Posted 21 October 2003 - 11:40 AM

In the php.ini file I found extension =msql.so commented
so i uncommented it and also changed the value to mysql.so

#4 shivabharat

shivabharat
  • Members
  • PipPipPip
  • Advanced Member
  • 371 posts
  • LocationChennai, India

Posted 21 October 2003 - 11:54 AM

Did that work also ensure that you have the mysql.so file in the exetsnion path you sepicified.
Knowledge --- Reading Enriches Mind But Sharing Enhances It.[br][br]Note: Before you request help enusre that you have had a look at the tutorials @phpfreaks

#5 rolling_titan

rolling_titan
  • New Members
  • Pip
  • Newbie
  • 3 posts
  • LocationPune,India

Posted 21 October 2003 - 12:53 PM

Fatal Error still exists.

I added
extension=mysql.so
extension=msql.so
extension imap.so
extension ldap.so
extension odbc.so
extension pgsql.so

anything to be added in LoadModule of httpd.conf ?

#6 spacecowboy

spacecowboy
  • New Members
  • Pip
  • Newbie
  • 1 posts
  • LocationAmsterdam - Netherlands

Posted 20 March 2004 - 05:16 PM

:huh:
Wondering if the problem has been solved in the meantime. I have a similar problem. The same fatal error when implementing the most simple database functionality in a php page. A message was posted on this board today, describing the problem.
<_<
After some searching for info on this, it turned out the file "mysql.so" is required. Your references also point to this file.
When doing a search (locate / find) on your system, you might find that this "mysql.so" shared object file is not present on the system. :(

If you have solved the problem, please let me know how you did it. As far as I can see it comes down to getting the required file on the system. However, I have not the faintest idea anymore how I can realize that.

Thanx in advance for your reply.

Grtz,
spacecowboy. B)

#7 stephenk

stephenk
  • Members
  • PipPipPip
  • Advanced Member
  • 62 posts

Posted 26 September 2005 - 03:12 PM

:huh:
Wondering if the problem has been solved in the meantime. I have a similar problem. The same fatal error when implementing the most simple database functionality in a php page. A message was posted on this board today, describing the problem.
<_<
After some searching for info on this, it turned out the file "mysql.so" is required. Your references also point to this file.
When doing a search (locate / find) on your system, you might find that this "mysql.so" shared object file is not present on the system.    :(

If you have solved the problem, please let me know how you did it. As far as I can see it comes down to getting the required file on the system. However, I have not the faintest idea anymore how I can realize that.

Thanx in advance for your reply.

Grtz,
spacecowboy.    B)

View Post



I used to have this problem too but I downloaded WAMP which has apache, mysql and PHP all in one and the latest versions too!

#8 Zane

Zane
  • Administrators
  • Advanced Member
  • 4,134 posts

Posted 26 September 2005 - 03:41 PM

check this link out
http://www.phpfreaks...hl=libmysql.dll

just replace libmysql.dll with libmysql.so

btn_donate_SM.gif Want to thank me? Contribute to my PayPal piggy-bank
 

172938.png




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users