Consider this simple code:
<?php
error_reporting(E_ALL);
//error_reporting(E_STRICT);
date_default_timezone_set('Asia/Calcutta');
$smtp_server = fsockopen("onelocalserver.com", 25, $errno, $errstr, 120);
if(!$smtp_server)
{
// We have an error, do something
echo " Error found! <br>$errno <br>$errstr";
exit;
}
?>
On Windows XP + php5.3.8 + apache 2.2, i get an error: Warning: fsockopen(): unable to connect to onelocalserver.com:25 (No connection could be made because the target machine actively refused it. )
However, on the same system where Apache and PHP are installed, if i run php from the command prompt ex: c:\php\php.exe filename.php (where above code is in the filename), then i don't get the error!
The server onelocalserver.com is listening on port 25 : there is an SMTP server running there.
Any ideas? This is really bizzare
Thanks in advance