Since last week I'm running in trouble with the Plesk RPC api. At the moment I'm in the progress of developing a custom made PHP-script to handle orders at my website, when a customers buys webhosting at the shop the script automatically creates the user account, creates the domain, add aliasses and all other stuff.
My script was working till last week and since then I've trouble with just 1 part of the script the creation of the domain itself. Creating of the user is working as expected.
The thing is it is a really strange issue as the domain itself is created on plesk but the output that I expect is not returned by plesk. Let me explain this a bit with some php snippets:
This is the code that is giving errors:
The first line createXML_DomainAdd creates a valid XML package to send to plesk, something like this:
$curl2 = sendCommand($xmlPacket2,$HOST,$PATH,$LOGIN,$PASSWD);
$response = parseCurl($curl2);
After the packet creation the packet is send to plesk with the SendCommand function:
And after that the output returned from plesk is analysed in ParseCurl function:
$url = "https://" . $host . ":8443". "/" . $path;
$headers = array(
"HTTP_AUTH_LOGIN: " . $login,
"HTTP_AUTH_PASSWD: " . $passwd,
// Initalize the curl engine
$ch = curl_init();
// Set the curl options
When I'm trying to load this in Firefox the following is taking place:
$result = curl_exec($ch);
$xml = new SimpleXMLElement($result);
- The xml packet is created
- XML packet is send to Plesk
- Plesk created the domain and domain is working fine
- I retreive an "Connection has been re-initialized" window in Firefox and the script stops here
- NO return output is retreived from plesk
when I do the same in Internet Explorer, i didn't receive the connection has been re-initialized screen but the pages loads, a white screen comes up and the page loads again.
After some troubelshooting I've found that Plesk is not returning any value in the parseCurl function, the status code that I retreive from $info['http_code'] is 0.
I can't get what's going wrong but I'm pretty sure that there is something wrong at plesk side now (as it was working till last week).
I installed latest updates today and also rebooted the server, but no luck..