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!

Using PHP to create Mysql databases issue

Discussion in 'cPanel Developers' started by Peter Sampson, Aug 21, 2018.

  1. Peter Sampson

    Peter Sampson Registered

    Joined:
    Aug 21, 2018
    Messages:
    1
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    Indianapolis, IN
    cPanel Access Level:
    Root Administrator
    I have been using xlmapi.php to create Mysql databases and users through PHP when my system creates a new user in my application. When I person signs up for the service, they are automatically created a Mysql user and database based on the username that they choose to use in the system. However, something on my service updated last night and now that is broken and no new users are being created. I also was using the same script to delete the database when a user leave the service and that script is no longer working either.

    It looks like xmlapi.php hasn't been updated in a little while. Does anyone have anything new that they use for something like this.

    I tried a few things with LiveAPI with cPanel and I just get an error stating

    "Fatal error: Uncaught exception 'RuntimeException' with message 'There was a problem fetching the env variablecontaining the path to the socket' in /usr/local/cpanel/php/cpanel.php:146
    Stack trace: #0 /usr/local/cpanel/base/frontend/paper_lantern/test.livephp(4): CPANEL->__construct() #1 {main} thrown in /usr/local/cpanel/php/cpanel.php on line 146"

    I appreciate your thoughts and suggestions.
     
  2. cPanelMichael

    cPanelMichael Technical Support Community Manager Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    47,555
    Likes Received:
    2,182
    Trophy Points:
    363
    cPanel Access Level:
    Root Administrator
    Twitter:
    Hi Peter,

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

    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

    The LiveAPI System provides environments for applications in the cPanel interface. It's not designed to work with Apache and PHP in scripts uploaded to your website.

    Thank you.
     
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