NewRehtse
NewRehtse

Reputation: 338

ISPConfig SOAP Remote API add web domain with php enabled

I am using the remote API of ispconfig to create an ispconfig user, a web site and a ftp user and everything is working okay, it creates the ispconfig user, the website and the ftp user, i can access them through ISPConfig and FTP and the web site works as well but it doesn't enable PHP even if I have it activated on the params.

Here is the necessary code:

$domain = 'domain.example.com';
$params = array(
        'domain' => $domain,
        'ip_address' => '',
        'type' => 'vhost',
        'parent_domain_id' => 0,
        'vhost_type' => '',
        'hd_quota' => 100,
        'traffic_quota' => 4000,
        'cgi' => 'n',
        'ssi' => 'n',
        'suexec' => 'n',
        'errordocs' => 1,
        'is_subdomainwww' => 1,
        'subdomain' => '',
        'php' => 'y', /* This is activated but it does nothing*/
        'ruby' => 'y', /*This is also activated and works*/
        'redirect_type' => '',
        'redirect_path' => '',
        'ssl' => 'n',
        'ssl_state' => '',
        'ssl_locality' => '',
        'ssl_organisation' => '',
        'ssl_organisation_unit' => '',
        'ssl_country' => '',
        'ssl_domain' => '',
        'ssl_request' => '',
        'ssl_cert' => '',
        'ssl_bundle' => '',
        'ssl_action' => '',
        'stats_password' => '',
        'stats_type' => 'webalizer',
        'allow_override' => 'All',
        'apache_directives' => '',
        'php_open_basedir' => '/', 
        'custom_php_ini' => '', 
        'backup_interval' => '',
        'backup_copies' => 1,
        'active' => 'y',
        'traffic_quota_lock' => 'n'
);

I don't think I need to write anything in 'custom_php_ini' , Am I correct?

I have a class to use ispconfig, and the method to create the website is:

public function addWebSite($clientid, $params) {
    $params['server_id'] = $this->server_id;
    utf8_encode_array($params,'utf8_decode_array');
    try {
        return $this->soapClient->sites_web_domain_add($this->session_id, $clientid, $params, $readonly = false);
    }  catch (SoapFault $e) {
        throw new IspcfgException($e->getMessage(), 500);
    }
}

In the creation of the ispconfig user I also put a param ''web_php_options' => 'mod' but it doesn't work...

Can anybody help me? Thank you very much for your help in advance!

I think that there is a parameter that I don't know to indicate the PHP Engine but I don´t find the correct documentation.

Upvotes: 2

Views: 4943

Answers (1)

NewRehtse
NewRehtse

Reputation: 338

I solved it.

I was looking at the documentation provided when you download the zip from the website and you can get it also here.

IF you look at the documentation it says that the param 'php' is an enum with values 'n' and 'y' but that works for the ipconfig version 2. In ispconfig3 you can edit the php engine (mod-php, cgi...) not just enable it.

So it works writing in $params:

 'php' => 'mod', 

Upvotes: 2

Related Questions