我想登录在cPanel通过Php脚本,并需要修改一些文件从文件管理器。
我有cPanel用户名和密码,但文件修改,我想通过PHP脚本没有图形。
我将使用file_put_content从文件管理器修改文件。
请参见以下代码:

发布于 2017-06-24 21:20:51
是的,有一种方法,CPanel有一个可以使用的应用程序接口。来自docs的示例
// Instantiate the CPANEL object.
require_once "/usr/local/cpanel/php/cpanel.php";
// Connect to cPanel - only do this once.
$cpanel = new CPANEL();
// Get domain user data.
$get_userdata = $cpanel->uapi(
'DomainInfo', 'domains_data',
array(
'format' => 'hash',
)
);
// Perform the desired actions.https://stackoverflow.com/questions/44733708
复制相似问题