Re: can't get fsockopen() to work through IIS

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

 



Evan Burkitt wrote:
> I have PHP 5.2.6 installed under Windows Server 2003 and IIS 6.0. I cannot 
> get fsockopen() to succeed when run through IIS.
> I'm using this script:
> <?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>
> 
> When I run it through a Web browser $fp is null, $errno is 0 and $errstr is 
> empty. When I run it from a command line, using the IIS Internet user's 
> credentials, the connection succeeds and $fp is non-null.
> 
> I would appreciate any suggestions. 
> 
> 
Take out the @ in front of fsockopen and see what the actual error is
would be the first step - it's generally a good idea to have E_ALL on
and all @ operators removed when trying to debug something

Thanks,
Elizabeth Smith

-- 
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