Please whitelist cPanel in your adblocker so that you’re able to see our version release promotions, thanks!

The Community Forums

Interact with an entire community of cPanel & WHM users!

API for database actions via PHP

Discussion in 'cPanel Developers' started by mainescott, Oct 10, 2018.

  1. mainescott

    mainescott Registered

    Joined:
    Oct 14, 2015
    Messages:
    2
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    Maine, USA
    cPanel Access Level:
    Website Owner
    We were previously using the XMLAPI to handle automated database provisioning through PHP code (creating databases, users, assigning permissions), but have been in a bind since the XMLAPI was deprecated.

    I've spent quite a few hours trying to get LiveAPI to work without success, using the information here: Guide to the LiveAPI System - PHP Class - Developer Documentation - cPanel Documentation

    Although I think I've followed all the steps correctly, I can't get past instantiating the CPANEL object, seemingly because it fails to find certain environmental variables that it's looking for.

    I also tried using the WHM API (Use WHM API to Call cPanel API and UAPI - Developer Documentation - cPanel Documentation), but ran into authorization issues and eventually hosed my cpanel user.

    I'm kind of at my wits' end. Can anyone suggest a good way to accomplish these tasks from PHP code or point me to a functional example of doing so?
     
  2. cPanelLauren

    cPanelLauren Forums Analyst II
    Staff Member

    Joined:
    Nov 14, 2017
    Messages:
    3,072
    Likes Received:
    215
    Trophy Points:
    173
    Location:
    Houston
    cPanel Access Level:
    DataCenter Provider
    Hi @mainescott

    I discussed this with one of our developers today and he let me know the following:

    Thanks!
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
Loading...

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice