Jump to content

Call to undefined function: mysql_connect()


rolling_titan

Recommended Posts

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

Link to comment
Share on other sites

  • 4 months later...

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

Link to comment
Share on other sites

  • 1 year later...
: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)

65316[/snapback]

 

 

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!

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.