Creating mysql databases with xmlapi.php issue

Daniel Enriquez

Registered
Aug 21, 2018
1
0
1
Mexico
cPanel Access Level
Root Administrator
Hello.

I have some problems with the new version of cpanel v74.

Previously I used xmlapi to create mysql databases and users from php script. Now with this version I cant do it anymore.

Do anyone knows how to achieve this with v74?.

Thanks.
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,911
2,234
363
Hello Daniel,

Support for the XML-like output of our API was removed from the product in cPanel & WHM version 74:

Removed XML output in API functions
In cPanel & WHM version 74, we removed the Extensible Markup Language (XML) output format from all of our API functions. We previously deprecated XML output in cPanel & WHM version 66.

Important:

You must use the JSON return format when you call API functions.
You must update your scripts to use the JSON output format to call WHM API and cPanel API functions.
If you'd like to develop PHP scripts that make use of UAPI or cPanel API 2 functions, then you'll need to use a different PHP client class. Here's a user-submitted PHP client class for UAPI that should help you get started:

N1ghteyes/cpanel-UAPI-php-class

Thank you.
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,911
2,234
363
Hello @jason213,

That's a user-submitted PHP client class for UAPI, so while it may offer insight into how you can create PHP scripts that make use of our UAPI functions, it's not supported or tested to work.

Note that you can still use the official cPanel PHP client class found at:

CpanelInc/xmlapi-php

While the XML serialization is no longer available, you should still be able to use the above package with JSON serialization. See the note below:

As of version 74, the XML serialization is no longer available in cPanel & WHM. However, despite the name of this package and the fact that it is obsolete, it should be possible to use this package with the JSON serialization (and only the JSON serialization) in version 74 and newer.
Thank you.