|
Prev: include and warning: headers already sent by ..
Next: Float value Division gives irrational results php 5.2.5
From: Evan Burkitt on 8 Feb 2008 19:21 I'm using IIS 6.0 on Windows 2003 server. There is a POP3 server running on the machine at port 110. When I run the following script in a browser (that is, through IIS) it reports "Could not connect to localhost at port 110 ($errno=12; $errstr=)". When I run it from a command prompt on the server the connection succeeds and the script reports "Socket connection established". The connection succeeds even when I run cmd.exe as the Internet guest user, which is the account IIS runs scripts under. Any ideas as to what's going on? -Evan ----- <?php $host = "localhost"; $port = "110"; ?> <html> <h1>Attempting to open socket on host '<?php echo ("$host")?>' at port '<?php echo ("$port")?>'</h1> <h2> <?php $errno = 0; $errstr = "<no error reported>"; $fp = @fsockopen($host, $port, $errno, $errstr); if ($fp) { echo "Socket connection established"; fclose($fp); }else { echo "Could not connect to $host at port $port (\$errno=$errno; \$errstr=$errstr)"; } ?> </h2> </html> |