fsockopen() fails in script run by IIS

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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>
--
PHP Windows Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [PHP Users]     [PHP Database Programming]     [PHP Install]     [Kernel Newbies]     [Yosemite Forum]     [PHP Books]

  Powered by Linux