I have script in PHP to get list of admins:
I get error 500 Internal Server Error.
When I comment:
I get 200, it works, set_login works. Password and username are the same that I use to login to DirectAdmin using webpage.
And I don't understand why catch don't handle exception and return status 500 ?
PHP:
<?php
include '../config/config.php';
include '../protocol/httpsocket.php';
$Socket = new HTTPSocket;
$Socket->connect($siteurl,$siteport);
$Socket->set_login($adminusername,$adminpassword);
try {
$Socket->query('/CMD_API_SHOW_ADMINS','');
} catch (Exception $e) {
echo "error";
// echo 'Caught exception: ', $e->getMessage(), "\n";
}
finally {
echo "First finally.\n";
}
?>
I get error 500 Internal Server Error.
When I comment:
PHP:
$Socket->query('/CMD_API_SHOW_ADMINS','');
And I don't understand why catch don't handle exception and return status 500 ?