Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Mysql_connect()

Status
Not open for further replies.

QatQat

IS-IT--Management
Joined
Nov 16, 2001
Messages
1,031
Location
IT
Hi There,

I finally moved my first steps with PHP after years with ASP.

Now, if I use mysql_connect function on a windoz system it works fine.

If running on mandrake or redhat it returns

Call to undefined function: mysql_connect() in /var/ on line 14

The same page has been used on all systems.

Why does this happen?

Thank you

Qatqat


Life is what happens when you are making other plans.
 
I have done a bit of research on the Internet and found that I was missing php-mysql.rpm.

After installing it though, same problem.
Is there some more configuration to do to make it work?


Thanks


Qatqat

Life is what happens when you are making other plans.
 
after intalling , restart httpd to make apache pick up the changes.

______________________________________________________________________
There's no present like the time, they say. - Henry's Cat.
 
I have done it but still no luck,

what next?


Bye

Qatqat

Life is what happens when you are making other plans.
 
Did you check if the MySQL daemon is running (mysqld)? Check the processlist or try to connect to the MySQL server on the command line:
Code:
mysql -h localhost -u root

Be sure to change the root password ASAP and create a other users so that root is only available for system maintenance. This is a generally recommended security precaution.
 
Of course it is running.

I think it is something to do with php configuration files.

if it is of any help I am using Apache 2 on RedHat 9.

If I try to re-install PHP/Apache/MySQL, is there any particular order I should do it?


Trying to do the same on windoz it worked immediately;
god...I must love Linux really too much...

Bye

QatQat

Life is what happens when you are making other plans.
 
did you issue a phpinfo()? it will show you whether php is compiled with mysql support (it should be by default!).

<?php
phpinfo();
?>

you should see something like '--with-mysql=shared,/usr' on 3th row called &quot;Configure Command&quot;.

In addition, on php.ini you should have the line:

extension=mysql.so

Cheers.

 
Ah .. hang on , flash back ... check in /var/log/httpd/error_log (redhat), I think you'll find you are missing a libmysqlclient.so library .... or have not got the path to it correct , had this with my redhat machine a year or so ago... (shows up when starting apache)

from / find the file you are missing and edit the httpd.conf to include it correctly.

(or update your redhat from install cd's and choose php-mysql when going through the packages.

______________________________________________________________________
There's no present like the time, they say. - Henry's Cat.
 
This is a printout from phpinfo().




MySQL Support enabled
Active Persistent Links 0
Active Links 0
Client API version 4.0.11a-gamma
MYSQL_MODULE_TYPE none
MYSQL_SOCKET /var/lib/mysql/mysql.sock
MYSQL_INCLUDE no value
MYSQL_LIBS no value

Directive Local Value Master Value
mysql.allow_persistent On On
mysql.connect_timeout -1 -1
mysql.default_host no value no value
mysql.default_password no value no value
mysql.default_port no value no value
mysql.default_socket no value no value
mysql.default_user no value no value
mysql.max_links Unlimited Unlimited
mysql.max_persistent Unlimited Unlimited
mysql.trace_mode Off Off


I will check the error log.

Thanks


Bye

Qatqat

Life is what happens when you are making other plans.
 
Status
Not open for further replies.

Similar threads

Part and Inventory Search

Sponsor

Back
Top