ID: 29576 Updated by: [EMAIL PROTECTED] Reported By: admin at php2tor dot com -Status: Feedback +Status: No Feedback Bug Type: Network related Operating System: Fedora Core 1 PHP Version: 4.3.8 New Comment:
No feedback was provided for this bug for over a week, so it is being suspended automatically. If you are able to provide the information that was originally requested, please do so and change the status of the bug back to "Open". Previous Comments: ------------------------------------------------------------------------ [2004-08-09 07:16:28] [EMAIL PROTECTED] Run this: strace -e trace=network php yourscript.php and paste the output here. Also, please try running telnet from the fedora machine to that IP and port combo to see if it does the same thing. ------------------------------------------------------------------------ [2004-08-09 02:25:14] admin at php2tor dot com Description: ------------ I'm using Fedora Core 1 and PHP 4.3.8 I'm using the fsockopen function to check status of port for a windows environment. I'm going thru the WAN to check this port which is two hops away. For some reason I had a routing issue to the destination network. I tried to ping the server from my windows workstation and I would get reply from the router (as opposed to just getting a request timeout message) saying the destination network was unavailable. Anyway, when I ran the script that checks the server (from the fedora machine), the php script would report the server as up, when in reality it couldn't be reached. I'm guessing cause the router respoded with reply messages that the fsockopen function assumes a connection is made? Reproduce code: --------------- $host = '192.168.1.1'; $port = '445'; $timeout = '2'; $fp = fsockopen($host, $port, $errno. $errstr, $timeout); if ($fp) { print 'server_up.gif'; }else{ print 'server_down.gif'; } Expected result: ---------------- Should show the host is not reachable and print "the device is down". Actual result: -------------- given the conditions mentioned above, the server should show down, but the fsockopen says its up. ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=29576&edit=1