How to connect cPanel’s ports using XML-API (PHP Class)?
cPanel’s XML-API is a wonderful way of doing stuffs programitically and remotely on its front end (domain owner control panel) and back end (WHM). However, the PHP client of XML-API, by default, connects to WHM Ports!
If you are wondering how to connect to front end and do stuffs using user’s credentials rather than root credentials, this tutorial will help you. Indeed, it is very easy to do. You need a single line of code to connect front end.
Let’s assume $cpanel is a instance of XML-API class. Now you can change it’s target port by the following line
$cpanel->set_port(2082); //you must supply it as integer
However, if you wish to connect to secured port, it will be
$cpanel->set_port(’2083′);
To use the cpanel’s username & password, you just need assign authentication credentials as follows:
$cpanel->password_auth("cpuser","cppass");
a WordPress rating system
Related posts:
- Disallow /cpanel, /webmail to be redirected to ssl/tls ports (2083, 2096)
- Opening ports in the firewall for the Mail Server
- Creating FTP accounts in Enkompass control panel!
- Configuring your Firewall for Webmin