• Plesk Uservoice will be deprecated by October. Moving forward, all product feature requests and improvement suggestions will be managed through our new platform Plesk Productboard.
    To continue sharing your ideas and feedback, please visit features.plesk.com

How to : database creation from third party application

amangoua

New Pleskian
Hi,

PRODUCT, VERSION, OPERATING SYSTEM, ARCHITECTURE =>

Parallels Panel 11.0.9
Ubuntu 12.04.4 LTS
Apache/2.2.22 / Mysql 3.5.8.1

PROBLEM DESCRIPTION =>

Is it possible to let Plesk allow database creation from another web application ?
For exaple, we would like to use this framework (codeigniter) method => $this->dbforge->create_database('db_name')

ACTUAL RESULT =>

The method returns false but i'm unable to track it on the error logs.

EXPECTED RESULT =>

The method should returns TRUE
And thus the database should be created

Is it some task we should manage at Plesk or Apache level ?

Help would be much appreciated.

Cheers,

Guillaume
 
Hi IgorG,

Thanks for the quick answer.
I will check this API and hopefully manage to use it properly.

Cheers,

Guillaume
 
Hi there,

I'm trying to get the php code sample working.

PROBLEM DESCRIPTION =>
The curl response raises the second exception (code 1005) in this method call =>

Code:
public function getResponse($response) {
               $xml  = new SimpleXMLElement($response);
               $xml_json = json_encode($xml);
               $xml_object = json_decode($xml_json);

               if (!is_a($xml, 'SimpleXMLElement')) {
                       throw new Exception('Cannot parse server response : '.$response);
               }

               if ($xml_object->system->status == 'error') {
                       throw new Exception('The Panel API returned an error : '.(string)$xml_object->system->errcode.' => '.(string)$xml_object->system->errtext);
               }

               $resultNode = $xml->domain->get->result;

               return $resultNode;
       }

ACTUAL RESULT =>
The Panel API returned an error :
1005 => Protocol version '0.0.0.0' is not supported. Current protocol version is '1.6.3.5'

Any idea ?

Cheers,

Guillaume
 
It looks like that <packet version="1.6.3.5"> is not specified.
 
Hi Igor,

The current xml file lokks like this :

Code:
<?xml version="1.0" encoding="UTF-8"?>
<packet version="1.6.3.4">
 <domain>
  <get>
   <filter/><dataset><hosting/><gen_info/></dataset>
  </get>
 </domain>
</packet>
 
Back
Top