I've been playing with PHP for about 6 years and I have no idea why this is
happening... I've been writing a script to auth to AD.  When I run the
script on my dev box, nothing.  I have wireshark running in the background
on the dev box, I can see the script's traffic go out and hit the DNS
server but no other traffic. Command line, no problem talking to other
hosts with whatever port I'm trying to hit.  On my box, all the scripts
work fine.  LDAP is enabled, but I can't hit ANY port other than DNS and if
I use the IP in the script, I see no traffic.  Both are FC16-64 patched as
of last week. I matched line-by-line in the phpinfo() on my box and the dev
box - no difference.  Used this script to try any port open on other hosts
but no traffic shows up in wireshark!! Any ideas????


 function ping($host,$post=25,$timeout=6)

  $fsock = fsockopen($host, $port, $errno, $errstr, $timeout);
  if ( ! $fsock )
   return FALSE;
   return TRUE;

/* check if the host is up $host can also be an ip address */
$host = 'mail.bac.com';
$up = ping($host);

/* optionally display either a red or green image to signify the server
status */
echo '<img src="'.($up ? 'on' : 'off').'.jpg" alt="'.($up ? 'up' :
'down').'" />';


or this one


//using ldap bind anonymously

// connect to ldap server
$ldapconn = ldap_connect("")
    or die("Could not connect to LDAP server.");

if ($ldapconn) {

    // binding anonymously
    $ldapbind = ldap_bind($ldapconn);

    if ($ldapbind) {
        echo "LDAP bind anonymous successful...";
    } else {
        echo "LDAP bind anonymous failed...";




LDAP Support enabled RCS Version $Id: ldap.c 321634 2012-01-01 13:15:04Z
felipe $ Total Links 0/unlimited API Version 3001 Vendor Name OpenLDAP Vendor
Version 20426 SASL Support Enabled

Reply via email to