Skip to main content

cpanel php class not creating object

Comments

5 comments

  • cPanelMichael
    Hello :) It looks like you have opened a support ticket (#7497341) for assistance with your custom application. Could you update us with the outcome once the ticket is closed? Thank you.
    0
  • radioative
    Hello :) It looks like you have opened a support ticket (#7497341) for assistance with your custom application. Could you update us with the outcome once the ticket is closed? Thank you.

    I have the same issue. Can you help me? Regards Felipe
    0
  • cPanelMichael
    I have the same issue. Can you help me?

    Could you verify the specific issue you are facing? For instance, what in particular is not working, and what steps have you taken thus far? Thank you.
    0
  • radioative
    I'm using this script (and nothing else) // Instantiate the CPANEL object. require_once "/usr/local/cpanel/php/cpanel.php"; // Connect to cPanel - only do this once. $cpanel = new CPANEL(); // Get domain user data. $get_userdata = $cpanel->uapi( 'DomainInfo', 'domains_data', array( 'format' => 'hash', ) ); Then, i get this error: 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 /home/mydomain/public_html/xmlapi/Examples/mycode.php(30): CPANEL->__construct() #1 {main} thrown in /usr/local/cpanel/php/cpanel.php on line 146
    0
  • cPanelMichael
    I'm using this script (and nothing else)

    The PHP client class is a good place to start: GitHub - CpanelInc/xmlapi-php: A PHP Class for Interacting with cPanel's XML-API The cPanel API 2 function for parking a domain name is documented at: cPanel API 2 Functions - Park::park - Software Development Kit - cPanel Documentation You may also find a thread like this one helpful: [Resolved] PHP Script creates email account but fails to create forwarder It's unrelated to parking a domain name, but offers an example of creating a PHP script with a different API function. Thank you.
    0

Please sign in to leave a comment.