我试图从我的网站CMS动态创建子域。
我已经创建了以下脚本: require_once "/usr/local/cpanel/php/cpanel.php";
$cpanel = new CPANEL();
$get_userdata = $cpanel->uapi(
'DomainInfo', 'domains_data',
array(
'format' => 'hash',
)
);
$addsubdomain = $cpanel->api2(
'SubDomain', 'addsubdomain',
array(
'domain' => ''. $subdomain .'',
'rootdomain' => 'REMOVED',
'dir' => '/public_html/',
'disallowdot' => '1',
)
);我收到以下错误:
PHP Fatal error: Uncaught exception 'RuntimeException' with message 'There was a problem fetching the env variablecontaining the path to the socket' in /usr/local/cpanel/php/cpanel.php:146为什么会这样?我做错了什么?
发布于 2020-03-12 22:47:55
当您试图在cPanel的文档根目录之外的PHP脚本中使用LiveAPI时,会出现此错误。
根据cPanel的说法,LiveAPI只能在cPanel的文档根目录下使用:/usr/local/cpanel/base/frontend/,/usr/local/cpanel/base/3rdparty/。
https://stackoverflow.com/questions/42554811
复制相似问题