第七色在线视频,2021少妇久久久久久久久久,亚洲欧洲精品成人久久av18,亚洲国产精品特色大片观看完整版,孙宇晨将参加特朗普的晚宴

為了賬號安全,請及時(shí)綁定郵箱和手機(jī)立即綁定
已解決430363個問題,去搜搜看,總會有你想問的

在php中動態(tài)創(chuàng)建子域(cpanel和hosting24)

在php中動態(tài)創(chuàng)建子域(cpanel和hosting24)

PHP
翻閱古今 2021-04-04 12:15:48
我正在嘗試使用php動態(tài)創(chuàng)建子域,以便每次有人創(chuàng)建用戶時(shí),他們也會創(chuàng)建一個子域。我似乎能找到的所有答案都是一樣的,只是行不通。即,這是最建議的代碼:function createDomain($domain) {        // your cPanel username        $cpanel_user = 'username';        $cpanel_pass = 'pass';        $cpanel_skin = 'paper_lantern';        $cpanel_host = 'mydomainname.com';        $subdomain = $domain;    // directory - defaults to public_html/subdomain_name    $dir = 'public_html/user_site';    // create the subdomain    $sock = fsockopen($cpanel_host,2082);    if(!$sock) {        print('Socket error');        exit();    }    $pass = base64_encode("$cpanel_user:$cpanel_pass");    $in = "GET /frontend/$cpanel_skin/subdomain/doadddomain.html?rootdomain=$cpanel_host&domain=$subdomain&dir=$dir\r\n";    $in .= "HTTP/1.0\r\n";    $in .= "Host:$cpanel_host\r\n";    $in .= "Authorization: Basic $pass\r\n";    $in .= "\r\n";    fputs($sock, $in);    while (!feof($sock)) {        $result = fgets($sock, 128);    }    fclose($sock);    return $result;}createDomain('testing');當(dāng)我嘗試直接在瀏覽器中使用鏈接查看發(fā)生了什么時(shí),cpanel告訴我安全令牌有問題,我得到了一個登錄表單。因此,我嘗試撥打電話以生成安全令牌:function createSession() { // Example details        $ip = "example.com";        $cp_user = "username";        $cp_pwd = "password";        $url = "https://example.com:2083/login";        $cookies = "/path/to/storage/for/cookies.txt";它成功創(chuàng)建了令牌。然后,我嘗試將安全令牌發(fā)送到另一個調(diào)用,因此將是這樣的:$token . "/frontend/paper_lantern/subdomain/doadddomain.html?rootdomain=" . $main_domain . "&domain=" . $sub_domain_name . "&dir=public_html/subdomains/" . $sub_domain_name但沒有任何反應(yīng),沒有錯誤,沒有創(chuàng)建子域。我該如何進(jìn)行這項(xiàng)工作?
查看完整描述

1 回答

  • 1 回答
  • 0 關(guān)注
  • 205 瀏覽

添加回答

舉報(bào)

0/150
提交
取消
微信客服

購課補(bǔ)貼
聯(lián)系客服咨詢優(yōu)惠詳情

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動學(xué)習(xí)伙伴

公眾號

掃描二維碼
關(guān)注慕課網(wǎng)微信公眾號