Friday, September 30, 2011

How to connect cPanel’s ports using XML-API (PHP Class)?

December 29, 2010 by  
Filed under cPanel

Leave a Comment

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");

GD Star Rating
a WordPress rating system
How to connect cPanel's ports using XML-API (PHP Class)?, 1.0 out of 10 based on 1 rating
Digg This
Reddit This
Stumble Now!
Buzz This
Vote on DZone
Share on Facebook
Bookmark this on Delicious
Kick It on DotNetKicks.com
Shout it
Share on LinkedIn
Bookmark this on Technorati
Post on Twitter
Google Buzz (aka. Google Reader)

Related posts:

  1. Disallow /cpanel, /webmail to be redirected to ssl/tls ports (2083, 2096)
  2. Opening ports in the firewall for the Mail Server
  3. Creating FTP accounts in Enkompass control panel!
  4. Configuring your Firewall for Webmin

Speak Your Mind

Tell us what you're thinking...
and oh, if you want a pic to show with your comment, go get a gravatar!
Click here to cancel reply.