普通网友 2013-02-13 10:28
浏览 44
已采纳

ISPConfig SOAP Remote API在启用php的情况下添加Web域

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.

  • 写回答

1条回答 默认 最新

  • doutan5337 2013-02-13 13:41
    关注

    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', 
    
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥20 西门子S7-Graph,S7-300,梯形图
  • ¥50 用易语言http 访问不了网页
  • ¥50 safari浏览器fetch提交数据后数据丢失问题
  • ¥15 matlab不知道怎么改,求解答!!
  • ¥15 永磁直线电机的电流环pi调不出来
  • ¥15 用stata实现聚类的代码
  • ¥15 请问paddlehub能支持移动端开发吗?在Android studio上该如何部署?
  • ¥20 docker里部署springboot项目,访问不到扬声器
  • ¥15 netty整合springboot之后自动重连失效
  • ¥15 悬赏!微信开发者工具报错,求帮改