Forum Discussion

Paul_Risk_10960's avatar
Paul_Risk_10960
Icon for Nimbostratus rankNimbostratus
Jul 15, 2009

iControl / PHP / XAMPP error

Hi everyone!

 

 

I've trying to get iControl working with PHP, and I'm quite new to both! :-)

 

 

I've taken the below code from this link:

 

http://devcentral.f5.com/Default.aspx?tabid=63&articleType=ArticleView&articleId=69

 

 

 

$username='USER_NAME';

 

$password='PASSWORD';

 

$hostname='HOST_NAME';

 

$wsdl="https://$hostname/iControl/iControlPortal.cgi?WSDL=LocalLB.Pool";

 

$location="https://$hostname/iControl/iControlPortal.cgi?";

 

 

try {

 

$client = new SoapClient($wsdl,array('location'=>$location,'login'=>$username,'password'=>$password));

 

$pool_list=$client->get_list();

 

$poolstatus=$client->get_object_status($pool_list);

 

$memberlist=$client->get_member($pool_list);

 

foreach ($pool_list as $index=>$pool)

 

{

 

$availability_status=$poolstatus[$index]->availability_status;

 

if ($availability_status == 'AVAILABILITY_STATUS_GREEN')

 

{

 

$color = "green";

 

$text = "white";

 

}

 

else {

 

$color = "red";

 

$text = "black";

 

}

 

echo "

\n\t$pool\n\t/br />\n";

 

 

foreach ($memberlist[$index] as $member_index=>$member_value)

 

{

 

$address=$member_value->address;

 

$port=$member_value->port;

 

echo "\t

\n\t\t$address:$port\n\t\t

 

\n\t

 

\n";

 

}

 

echo "

 

\n\n";

 

}

 

}

 

catch (Exception $e) {

 

echo "Error!

 

";

 

echo $e -> getMessage ();

 

}

 

?>

 

 

 

I've put in my correct username/password and hostname (which I know all work if I browse to it) and I've installed a version of XAMPP to run PHP/Apache etc, etc on my Windows machine, but I get this error:

 

 

 

Warning: SoapClient::SoapClient() [soapclient.soapclient]: I/O warning : failed to load external entity "https://192.168.10.203/iControl/iControlPortal.cgi?WSDL=LocalLB.Pool" in C:\xampp\htdocs\icontrol-demo.php on line 9

 

Error!

 

SOAP-ERROR: Parsing WSDL: Couldn't load from 'https://192.168.10.203/iControl/iControlPortal.cgi?WSDL=LocalLB.Pool' : failed to load external entity "https://192.168.10.203/iControl/iControlPortal.cgi?WSDL=LocalLB.Pool"

 

 

 

Any ideas? I'm hoping it's really simple!

 

 

Thanks,

 

Risky.

4 Replies

  • Hi Risky,

     

     

    One of the reasons you would get "failed to load external entity " error is if PHP SOAP client cannot connect to the server or cannot find iControlPortal.cgi at the specified URL..

     

     

    What do you get when you browse to: https://192.168.10.203/iControl/iControlPortal.cgi?

     

     

    You should get a list of iControl APIs entitled "Available iControl Service Descriptions"..

     

     

    Do you have a personal firewall on your PC blocking outgoing connections from unrecognised exe-files? In case of XAMPP you will see httpd.exe (Apache component of XAMPP) trying to establish connection from your PC to port 443 on your BIG-IP box (192.168.10.203)

     

     

    Sam

     

  • Hi Paul,

     

     

    Do you have a recent version of Zend installed? It looks like there was an issue with one of the library files in recent builds. There is a link to a hotfix for it here:

     

    http://forums.zend.com/viewtopic.php?f=8&t=399

     

     

     

    We were able to reproduce the problem in a chroot environment.

     

    The problem seemed to be related to libxml (the base for the wsdl parser) statically loaded.

     

    These new binaries will load the libxml dynamically from the OS.

     

    You can find them under the folder ‘EcommLink’ :

     

    ftp://zenduser:4support@ftp.zend.com/

     

     

     

     

    The FTP link is for a Linux so file though. So you might just try updating your stack to the most recent version of Zend.

     

     

    Aaron
  • Thanks both Sam and Aaron for your replies. I checked everything you both said and then did a little more hunting. It appears that my problem was due to the fact that iControl is over HTTPS/SSL which XAMPP doesn't like by default. I needed to enable the php_openssl.dll extension in the php.ini file and now it works great!

     

     

    Thanks again for the help!

     

     

    Risky.
    • bkhanal's avatar
      bkhanal
      Icon for Nimbostratus rankNimbostratus

      I am running into same error but I confirmed php_openssl.dll extension is enabled in php.ini file. What else could I try?