Forum Discussion
Paul_Risk_10960
Nimbostratus
Jul 15, 2009iControl / 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.
- samstep
Cirrocumulus
Hi Risky, - hoolio
Cirrostratus
Hi Paul, - Paul_Risk_10960
Nimbostratus
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!- bkhanal
Nimbostratus
I am running into same error but I confirmed php_openssl.dll extension is enabled in php.ini file. What else could I try?
Recent Discussions
Related Content
DevCentral Quicklinks
* Getting Started on DevCentral
* Community Guidelines
* Community Terms of Use / EULA
* Community Ranking Explained
* Community Resources
* Contact the DevCentral Team
* Update MFA on account.f5.com
Discover DevCentral Connects