Hi Everyone,
I’m facing strange problem. I hope one of Cpanel experts can solve it.
The following code is to create database for cpanel remotely using Cpanel API (without Root credentials):
This work fine IF I set
Server Configuration »Tweak Settings » Security »Tweak Settings» Require SSL => OFF
However, I want it through secure connection. So I modified the code to use port 2083 instead ($xmlapi->set_port( '2083' ); // PORT SETTING).
But, it does not work (connection time out). Same problem happened even If I modified the server configuration to require SSL:
Server Configuration »Tweak Settings » Security »Tweak Settings» Require SSL => ON
Any help, idea. Plz share you experience!
I’m facing strange problem. I hope one of Cpanel experts can solve it.
The following code is to create database for cpanel remotely using Cpanel API (without Root credentials):
Code:
<?php
include("xmlapi.php");
$db_host = "213.136.xx.xxx";
$cpaneluser = "cpanelusername";
$cpanelpass= "cpanelpassword";
$xmlapi = new xmlapi($db_host);
$xmlapi->set_port( '2082' ); // PORT SETTING
$xmlapi->password_auth("".$cpaneluser."","".$cpanelpass."");
$xmlapi->set_debug(1);//output actions in the error log 1 for true and 0 false
$xmlapi->set_output('array');//set this for browser output
//create database
$databasename="dbname";
$createdb = $xmlapi->api1_query($cpaneluser, "Mysql", "adddb", array($databasename));
echo "Good Job";
?>
Server Configuration »Tweak Settings » Security »Tweak Settings» Require SSL => OFF
However, I want it through secure connection. So I modified the code to use port 2083 instead ($xmlapi->set_port( '2083' ); // PORT SETTING).
But, it does not work (connection time out). Same problem happened even If I modified the server configuration to require SSL:
Server Configuration »Tweak Settings » Security »Tweak Settings» Require SSL => ON
Any help, idea. Plz share you experience!