cpanel php class not creating object
We used "cPanel API2" library to create park domain in our server and it was working fine until last cPanel up-gradation.
We created file mytest.live.php on server to create a object of "CPANEL class" for troubleshooting the issue, but unfortunately it returns error as below.
And Output Returns:
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/cityusa/public_html/mytest.live.php(4): CPANEL->__construct() #1 {main} thrown in /usr/local/cpanel/php/cpanel.php on line 146
So please help for resolve this issue asap.
-
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 -
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 Felipe0 -
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 -
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 -
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.
Comments
5 comments