我得到了类对象代码,它有助于在cpanel中创建目录,但代码需要一个库或一个类。我的名字是cpanel.php我需要这个库或类,有人能在这方面帮我吗?
我只想在cpanel api的帮助下在cpanel中创建目录或上传文件。
这是cpanel api的url,它有助于检查创建directory code。
(LiveAPI PHP类)提前感谢,更大的帮助将是非常感谢的!
发布于 2018-01-01 21:26:25
您需要按照以下步骤使用cpanel API制作目录
require_once '../components/xmlapi.php';
$xmlapi = new \xmlapi($cpanel_domain);
$xmlapi->password_auth($username,$password);
$xmlapi->set_port(2083);
$result = $xmlapi->api1_query($password, 'CustInfo', 'getemail', array());
if(isset($result->error) && $result->error!=""){
// error log here
}
$api2args = array(
'path'=> 'public_html',
'name' => $newdir_name,
'permission' => '0755',
);
$result = $xmlapi->api2_query($cpanel_username, 'Fileman', 'mkdir', $api2args);你可以从这里下载所需的xmlapi文件:- https://github.com/CpanelInc/xmlapi-php,因为它在这里,也在开发者资源部分。https://documentation.cpanel.net/display/SDK/Software+Development+Kit+Home
https://stackoverflow.com/questions/44283070
复制相似问题