Jump to content

Archived

This topic is now archived and is closed to further replies.

rolling_titan

Call to undefined function: mysql_connect()

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

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

In the php.ini file I found extension =msql.so commented

so i uncommented it and also changed the value to mysql.so

Share this post


Link to post
Share on other sites

Did that work also ensure that you have the mysql.so file in the exetsnion path you sepicified.

Share this post


Link to post
Share on other sites

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 ?

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites
: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!

Share this post


Link to post
Share on other sites

×

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.