DeveloperSide.NET Forums
May 23, 2019, 07:14:09 AM *
Welcome, Guest. Please login or register.

Login with username, password and session length
News:
 
   Home   Help Search Login Register  
Pages: [1]
  Print  
Author Topic: seperate db server  (Read 13223 times)
0 Members and 1 Guest are viewing this topic.
4bgjnsn
Guest
« on: August 06, 2003, 05:21:58 PM »

If I have two seperate servers talking through a router, one is the web server with apache2 and php and the other is just mysql, then how do I ./configure php for mysql.

Thanks in Advance.
Logged
Jorge
Customer, Basic Support
Guru
*****
Posts: 544

jorge_schrauwen@msn.com
View Profile WWW
« Reply #1 on: August 06, 2003, 06:52:29 PM »

Don't need to,
Let say your external ip is 1.2.3.4,
And your pc with apache's internal op is 192.168.2.2
And you sql server = 192.168.2.3
The your router will serve:
1.2.3.4:80
1.2.3.4:3306
So no problem  8)
Logged

admin
Administrator
Master of All Subjects
*****
Posts: 3272


View Profile WWW Email
« Reply #2 on: August 07, 2003, 02:37:35 AM »

Quote
If I have two seperate servers talking through a router, one is the web server with apache2 and php and the other is just mysql, then how do I ./configure php for mysql.


If I understand you right...

To make a connection between PHP and MySQL, you do so through a PHP script.

For a local connection, you do something like this...

Code:
$db = mysql_connect('localhost', 'user', 'password') or die('Could not connect to MySQL: ' . mysql_error());


To connect PHP with MySQL on a different server, change the 'localhost' to the IP address of the MySQL server.

That is all assuming you have the router set up to connect the two servers.
Logged

DeveloperSide.NET
Advanced PHP and MySQL Solutions for your Web Design and Development needs with Web.Developer Server Suite.
admin
Administrator
Master of All Subjects
*****
Posts: 3272


View Profile WWW Email
« Reply #3 on: August 07, 2003, 03:37:18 AM »

As far as...

Code:
./configure --with-mysql=/usr/local/mysql


PHP just needs some libs from MySQL, and if I am not mistaken, already comes with that built in, in the newer versions.

Either have a local mysql installation, or just do...

Code:
./configure --with-mysql


There is no specific direct PHP<->MySQL joining in the PHP build process.  PHP can connect to any MySQL server.
Logged

DeveloperSide.NET
Advanced PHP and MySQL Solutions for your Web Design and Development needs with Web.Developer Server Suite.
Jorge
Customer, Basic Support
Guru
*****
Posts: 544

jorge_schrauwen@msn.com
View Profile WWW
« Reply #4 on: August 07, 2003, 06:47:46 AM »

Is that needed?
If you enther the external ip,
It will redirect port 3306 ot the computer with sql if you router is set up okwkey
Logged

Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.9 | SMF © 2006-2009, Simple Machines LLC Valid XHTML 1.0! Valid CSS!