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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to connect Php and Mysql?

Status
Not open for further replies.

william6789

Technical User
Mar 14, 2003
21
0
0
CA
Hi,
I installed PHP, Apache, and Mysql in redhat 8.0, and all these services have been started. Each of them can work, but when I try to connect Mysql from PHP file, it does not work.
I thik I need to install something like MyODBC in wondiws for communication between PHP and Mysql. What is it and how to insatll?
Thanks in advance.

Best Regards

William
 
OK what the heck has Wondiws got to do with this the php files should be on the Redhat server. Unless you are also running apache and PHP on an M$ box to read the MySQL database on the RH server. If you are, Y?
 
Hi,

To get PHP to talk to MySQL, you need to set the --with-mysql option when you run configure. This is the script I use, you will have to create one for your own needs:
[tt]
# Assumes MySQL is installed in /usr/local.
cd php
CFLAGS='-O2 -I../openssl' ./configure --with-apache=../apache --with-mysql=/usr/local --enable-track-vars --with-mhash --with-mcrypt
gmake
gmake install
[/tt]
Note the use of the --with-apache option also. Generally speaking, a binary distribution will not serve typical web-database-php integration needs, so you will have to build it yourself from source.

Good luck,
Chuck
 
I just went out and downloaded phpMyAdmin and it took care of my php mysql probelms. I hope that this helps.


 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top