Hi,
I'm trying to use the Plesk RPC API, and I can't log-in correctly.
I use the following PHP code, taken from several example I found:
I always get the following error, when I try with the admin login.
Should I use another login? I tried with the login of the client level user and it didn't work either.
Thanks!
I'm trying to use the Plesk RPC API, and I can't log-in correctly.
I use the following PHP code, taken from several example I found:
define ('HOST', 'myserver.com');
define ('PORT', 8443);
define ('PATH', 'enterprise/control/agent.php');
$url = 'https://' . HOST . ':' . PORT . '/' . PATH;
echo $url;
$headers = array(
'HTTP_AUTH_LOGIN: admin',
'HTTP_AUTH_PASSWD: xxxx',
'Content-Type: text/xml'
);
// initialize the curl engine
$ch = curl_init();
// set the curl options:
// do not check the name of SSL certificate of the remote server
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, true);
// do not check up the remote server certificate
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, true);
// pass in the header elements
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
// pass in the url of the target server
curl_setopt($ch, CURLOPT_URL, $url);
// tell CURL to return the result rather than to load it to the browser
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_POST, true);
I always get the following error, when I try with the admin login.
error 1001 Authentication failed - wrong password.
Should I use another login? I tried with the login of the client level user and it didn't work either.
Thanks!