如何在cpanel中添加动态子域

编程入门 行业动态 更新时间:2024-10-28 18:27:57
本文介绍了如何在cpanel中添加动态子域的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我有一个PHP脚本,可以让你在godaddy的cpanel中添加动态子域名。但问题是没有向cpanel添加子域。任何建议或帮助将不胜感激。谢谢。 我尝试过:

I have a PHP script that will let you add a dynamic subdomain in cpanel from godaddy. But the problem is not adding a subdomain to the cpanel. Any advice or help will be much appreciated thank you. What I have tried:

$whmusername = "sample"; $whmpassword = "@sample"; $subdomain = "mytestdomain"; $rootdomain = "sample"; $query = "".$rootdomain.":2087/json-api/cpanel?user=".$whmusername."&cpanel_jsonapi_module= SubDomain&cpanel_jsonapi_func=addsubdomain&cpanel_jsonapi_version=2&domain=".$subdomain."&rootdomain=".$rootdomain; $curl = curl_init(); curl_setopt($curl, CURLOPT_SSL_VERIFYPEER,0); curl_setopt($curl, CURLOPT_SSL_VERIFYHOST,0); curl_setopt($curl, CURLOPT_HEADER,0); curl_setopt($curl, CURLOPT_RETURNTRANSFER,1); $header[0] = "Authorization: Basic " . base64_encode($whmusername.":".$whmpassword) . "\n\r"; curl_setopt($curl, CURLOPT_HTTPHEADER, $header); curl_setopt($curl, CURLOPT_URL, $query); $result = curl_exec($curl); if ($result == false) { error_log("curl_exec threw error \"" . curl_error($curl) . "\" for $query"); } curl_close($curl); print $result;

推荐答案

whmusername = sample; whmusername = "sample";

whmpassword = @样品; whmpassword = "@sample";

subdomain = mytestdomain; subdomain = "mytestdomain";

更多推荐

如何在cpanel中添加动态子域

本文发布于:2023-11-24 04:00:13,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1623894.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:动态   如何在   cpanel

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!