Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

PHP Forum


You are currently viewing our PHP Forum as a guest. Please register to participate.
Login



Freelance Jobs

Reply
Troubles with cPanel script
Old 02-06-2009, 08:01 AM Troubles with cPanel script
Experienced Talker

Posts: 44
Trades: 0
I'm looking for a class that allows me the send commands from my PHP script to cPanel, but I've some troubles finding a proper. This seems to be the best script I've found:
http://www.phpclasses.org/browse/package/3534.html

However when I run the commands from the example I receive nothing but the title text only, which means that this:
echo 'Hosting Package: ' . $cPanel->getHostingPackage() . '<br>';

Returns only this:
Hosting Package:

I'm not using SSL


Hope some of you can help me, and it doesn't have to be that script, just need to communicate between my site and cPanel.
Onkel E is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 02-06-2009, 05:20 PM Re: Troubles with cPanel script
Junior Talker

Posts: 2
Location: Houston, TX
Trades: 0
Quote:
Originally Posted by Onkel E View Post
I'm looking for a class that allows me the send commands from my PHP script to cPanel, but I've some troubles finding a proper. This seems to be the best script I've found:
http://www.phpclasses.org/browse/package/3534.html

However when I run the commands from the example I receive nothing but the title text only, which means that this:
echo 'Hosting Package: ' . $cPanel->getHostingPackage() . '<br>';

Returns only this:
Hosting Package:

I'm not using SSL


Hope some of you can help me, and it doesn't have to be that script, just need to communicate between my site and cPanel.
You may wish to make use of the cPanel APIs directly if you have a reseller account:

http://cPanel.net/plugins/xmlapi

If you need help finding a specific API for what you're looking to do, please let me know. Our API documentation is still a work in progress so not everything is documented yet.
cPanelDavidG is offline
Reply With Quote
View Public Profile Visit cPanelDavidG's homepage!
 
Old 02-06-2009, 11:52 PM Re: Troubles with cPanel script
Experienced Talker

Posts: 44
Trades: 0
Thanks, I've been looking into it a bit, but I'm not sure how to call the XML API from PHP. Do you have any simple example of any function that shows how to call function from PHP?
Onkel E is offline
Reply With Quote
View Public Profile
 
Old 02-09-2009, 12:30 PM Re: Troubles with cPanel script
Junior Talker

Posts: 2
Location: Houston, TX
Trades: 0
Quote:
Originally Posted by Onkel E View Post
Thanks, I've been looking into it a bit, but I'm not sure how to call the XML API from PHP. Do you have any simple example of any function that shows how to call function from PHP?
There are very many code samples in PHP on our developer forums at:

http://forums.cpanel.net/forumdisplay.php?f=42
cPanelDavidG is offline
Reply With Quote
View Public Profile Visit cPanelDavidG's homepage!
 
Old 02-10-2009, 03:33 PM Re: Troubles with cPanel script
Novice Talker

Posts: 10
Location: Ga
Trades: 0
here is a simple way to change a users password on a cPanel server
PHP Code:
$authstr 'serverusername:accesshash';
$host 'https://yourserver.com:2087/xml-api/passwd';
$data '?user=username&pass=newpassword';
$ch curl_init();
curl_setopt($chCURLOPT_SSL_VERIFYPEER,0);
curl_setopt($chCURLOPT_SSL_VERIFYHOST,0);
curl_setopt($chCURLOPT_URL$host $data);
curl_setopt($chCURLOPT_HEADER0);
curl_setopt($chCURLOPT_RETURNTRANSFER,1);
$headers[0] = "Authorization: WHM $authstr";
curl_setopt($ch,CURLOPT_HTTPHEADER,$headers);
$result=curl_exec ($ch);
curl_close ($ch); 
I have not tested this, but i believe it will work.
__________________

Please login or register to view this content. Registration is FREE
WebDoc is offline
Reply With Quote
View Public Profile Visit WebDoc's homepage!
 
Reply     « Reply to Troubles with cPanel script
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.15413 seconds with 12 queries