• Introducing WebPros Cloud - a fully managed infrastructure platform purpose-built to simplify the deployment of WebPros products !  WebPros Cloud enables you to easily deliver WebPros solutions — without the complexity of managing the infrastructure.
    Join the pilot program today!
  • The Horde component is removed from Plesk Installer. We recommend switching to another webmail software supported in Plesk.
  • The BIND DNS server has already been deprecated and removed from Plesk for Windows.
    If a Plesk for Windows server is still using BIND, the upgrade to Plesk Obsidian 18.0.70 will be unavailable until the administrator switches the DNS server to Microsoft DNS. We strongly recommend transitioning to Microsoft DNS within the next 6 weeks, before the Plesk 18.0.70 release.

Plesk API

J

jefwic

Guest
Hi everyone,

I am trying to integration the Plesk API (which uses XML) with some of my PHP scripts. I haven't worked much with XML, however have read through the tutorials on w3schools.com and am still a little stumped. It would be greatly appreciated if someone could help me with this.


Plesk API Documentation lists the schemas that Plesks uses, and I believe this shows how to use the right commands (is this correct?).

I am trying to use this code:

Code:
$data =<<<EOF
<?xml version="1.0" encoding="UTF-8" standalone="no" ?>
<packet version="$proto">
<server>
<get>
<permissions/>
</get>
</server>
</packet>
EOF;
(the $data is part of the PHP submitting)

and the returned XML is

Code:
<?xml version="1.0" encoding="UTF-8"?>
<packet version="1.3.1.0">
  <server>
    <get>
      <result>
        <status>ok</status>
      </result>
    </get>
  </server>
</packet>
(which is the same as if no specific commands are sent)

Code:
$data =<<<EOF
<?xml version="1.0" encoding="UTF-8" standalone="no" ?>
<packet version="$proto">
<server>
<get>
<gen_info/>
</get>
</server>
</packet>
EOF;
gets
Code:
  <?xml version="1.0" encoding="UTF-8" ?> 
- <packet version="1.3.1.0">
- <server>
- <get>
- <result>
  <status>ok</status> 
- <gen_info>
  <server_name>TechServer.prod.phx1.secureserver.net</server_name> 
  </gen_info>
  </result>
  </get>
  </server>
  </packet>

I think I'm just a little off in my coding. What I am trying to get is the permissions for a client named "Hosting". If someone knows what I am doing wrong / how to fix it / or where I can learn to do it right it would be great.

Thanks,
Jeff
 
Hi, I have managed to get everything working ! :D

However, one question, how do you get the API to enable Apache ASP? I have tried <asp>true</asp> however this is not enabling it, everything else works fine.

Is it possible I am just doing this wrong - that the <asp> is for asp on a windows server on not Apache ASP?

Thanks,
Jeff

EDIT: After re-checking documentation <asp> is definately for Apache ASP. This is possibly a bug. Anyone else had success/problems with this?
 
You can not set asp using the API. It's a bug that will be fixed in 7.5.4.
 
Thanks. Do you know if it worked in previous versions, such as 7.5.2?

Jeff
 
Back
Top