RE: [PHP] PHP On Solaris 9 - MySQL Problem
| From: | Cameron B. Prince | Date: | Thu, 18 Mar 2004 16:17:28 +0000 |
| Subject: | RE: [PHP] PHP On Solaris 9 - MySQL Problem | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-180847@lists.php.net to get a copy of this message | ||
Hi Tom,
This was a good idea...
> You might try an fsockopen() to port 3306 on the dbserver and
> see if it works. If not, you get a reasonably descriptive error.
>
> I just tried a couple of known servers and bogus addresses with this
> code:
>
> <?php
> $ipaddr = "localhost"; # substitute the IP address here $fp
> = fsockopen($ipaddr, 3306, $errno, $errstr, 5.0);
> var_dump($fp, $errno, $errstr); if ($fp)
> fclose($fp);
> ?>
I setup the test page and pointed to the dbserver:
IP: 192.168.1.44
resource(2) of type (stream) int(0) string(0) ""
I then pointed it at localhost:
IP: localhost
resource(2) of type (stream) int(0) string(0) ""
And then another webserver without MySQL:
IP: 192.168.1.26
bool(false) int(146) string(18) "Connection refused"
I'm sure this is good to know because it proves at least part of PHP can
reach the other machine... Which hopefully rules out a TCP/IP problem. I'm
going to enable debugging on the MySQL server and see if that tells me
anything.
Thanks,
Cameron