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

报告相同问题?

悬赏问题

  • ¥50 永磁型步进电机PID算法
  • ¥15 sqlite 附加(attach database)加密数据库时,返回26是什么原因呢?
  • ¥88 找成都本地经验丰富懂小程序开发的技术大咖
  • ¥15 如何处理复杂数据表格的除法运算
  • ¥15 如何用stc8h1k08的片子做485数据透传的功能?(关键词-串口)
  • ¥15 有兄弟姐妹会用word插图功能制作类似citespace的图片吗?
  • ¥200 uniapp长期运行卡死问题解决
  • ¥15 latex怎么处理论文引理引用参考文献
  • ¥15 请教:如何用postman调用本地虚拟机区块链接上的合约?
  • ¥15 为什么使用javacv转封装rtsp为rtmp时出现如下问题:[h264 @ 000000004faf7500]no frame?