cPanel API 2 add addon domain error
Hello, i am having a problem when i try to add a addon domain, when i try it it gives me a error. All other APIs functions work only this one doesn't. Here is my code and error.
PHP Code:
[PHP]function test_api() {
global $cpanelhost;
global $cpaneluser;
global $cpanelpass;
$xmlapi = new xmlapi($cpanelhost);
$xmlapi->password_auth("".$cpaneluser."","".$cpanelpass."");
$xmlapi->set_port(2082);
$xmlapi->set_debug(1);
$xmlapi->set_output('array');
$add_domain = $xmlapi->api2_query($cpaneluser, 'AddonDomain', 'addaddondomain', array('dir' => 'public_html/shikoshkarko', 'newdomain' => 'shikoshkarko.com', 'subdomain' => 'shikoshkarko.ideviceblog.org'));
print_r($add_domain);
echo '
'; if($add_domain[data][result] == 1){ echo $add_domain[data][reason].'
'; } else { echo $add_domain[data][reason].'
'; } }[/PHP] Error: Array ( [apiversion] => 1 [error] => "/usr/local/cpanel/cpanel" exited with status 2 (ENOENT). [data] => Array ( [result] => 0 [reason] => "/usr/local/cpanel/cpanel" exited with status 2 (ENOENT). ) )
'; if($add_domain[data][result] == 1){ echo $add_domain[data][reason].'
'; } else { echo $add_domain[data][reason].'
'; } }[/PHP] Error: Array ( [apiversion] => 1 [error] => "/usr/local/cpanel/cpanel" exited with status 2 (ENOENT). [data] => Array ( [result] => 0 [reason] => "/usr/local/cpanel/cpanel" exited with status 2 (ENOENT). ) )
-
I'm having the same issue on my shared hosting account, and I think it may be disabled by them. I'm also getting in the response that the apiversion is 1, when it normally returns as 2, and we're calling api2_query. If you find any direction will you please post it here? I'll do the same 0 -
$add_domain = $xmlapi->api2_query($cpaneluser, 'AddonDomain', 'addaddondomain', array('dir' => 'public_html/shikoshkarko', 'newdomain' => 'shikoshkarko.com', 'subdomain' => 'shikoshkarko.ideviceblog.org'));
Hello :) The subdomain entry should read as "shikoshkarko" in the example you provided instead of using the full subdomain. I'm unable to reproduce this issue on a test server. Do you have root access to the system? Thank you.0 -
The subdomain entry should read as "shikoshkarko" in the example you provided instead of using the full subdomain. I'm unable to reproduce this issue on a test server. Do you have root access to the system?
I've tried changing the subdomain to just the name itself and that returns the same error message. I have tried switching to json output, which does return that the apiversion equals 2, but the same error. My Cpanel version is 11.48.5 and I do not have root access. I do not have permission to view /usr/local/cpanel/ or any of cpanels error logs0 -
My Cpanel version is 11.48.5 and I do not have root access. I do not have permission to view /usr/local/cpanel/ or any of cpanels error logs
Have you reported the issue to your web hosting provider so they can take a closer look? Note that cPanel version 11.48 is close to end-of-life: 11.48 to EOL in 2 Months | cPanel Newsroom Thank you.0 -
I did the same thing but it shows the same error like @JaredE, I am going to report the issue to my host provider right now and let you guys know. 0 -
I contacted my host provider and i told him what was the problem, they said that 'You need permission', 'Ask the owner for access'. What does this mean?? 0 -
My hosting provider said the function was disabled but that it may become available later, and that it was scheduled for upgrade. 0 -
You may also want to verify you can add the addon domain name manually through the cPanel interface. Thank you. 0 -
You may also want to verify you can add the addon domain name manually through the cPanel interface. Thank you.
It works fine when i add a addon domain through cPanel0 -
It works fine when i add a addon domain through cPanel
Assuming you don't have root access to the server, and it's on version 11.48, please provide your hosting provider with the following URL to let them know version 11.48 is EOL: cPanel & WHM Now 11.48 | cPanel Newsroom Thank you.0
Please sign in to leave a comment.
Comments
10 comments