Re: Question on the port PHP uses to connect to remote MySQL
| From: | Jason Wong | Date: | Thu, 30 Jan 2003 07:34:01 +0000 |
| Subject: | Re: Question on the port PHP uses to connect to remote MySQL | ||
| References: | 1 2 | Groups: | php.db |
| Request: | Send a blank email to php-db+get-25249@lists.php.net to get a copy of this message | ||
On Thursday 30 January 2003 08:59, Louis Feng wrote:
> Thanks for your help. The machine [A] is running MySQL is Not behind a
> firewall, therefore all connection to [A] works fine (including 3306).
> The machine [B] running PHP/apache is behind a firewall, and only port
> 80 is open on [B]. If I want to do some query on MySQL of [A] from [B]
> where PHP resides, then the problem occurs (from other machines without
> firewall to do the query on [A] work fine). Basically PHP can send out
> query to [A] (since [A] is open), but when [A] returns the result to
> PHP, it's blocked by the firewall on [B], because I believe PHP uses
> certain port for MySQL return the result. Is it clear?
What firewall/settings are you using? In a standard firewall works something
like this:
[B] PHP sends request FROM port <xxxx> TO [A] port <3306>
Because the request was initiated from within the firewall it should open up
port <xxxx> and allow the return result from [A] to pass back through.
And as I mentioned before <xxxx> is not fixed but should be > 1024. So
basically your firewall needs to allow:
SRC, internal, all non-privileged ports --> DST, external, port 3306
SRC, external, port 3306 --> DST, internal, all non-privileged ports
Also this is getting way off-topic.
--
Jason Wong -> Gremlins Associates -> www.gremlins.biz
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *
/*
GOOD-NIGHT, everybody ... Now I have to go administer FIRST-AID to my
pet LEISURE SUIT!!
*/