WHM Plug-In
From PhpCOIN Documentation
Developer: Keith D. Holler (azcappy) - bugs@azcappy.com
Current Version: v1.4.4
The WHM Plug-In and this documentation assumes that you have at least a basic knowledge of and rudimentary skills in PHP, HTML, MySQL & cPanel operations. Before installing the WHM Plug-In, you MUST completely configure phpCOIN. It gathers all of its information for operation from phpCOIN. If you do not have it completely configured, IT WILL NOT WORK.
About The WHM Plug-In
The WHM Plug-In began life in 2003 as the brain-child of Jeremi Bergman. He continued development until the final v1.3.4 released on August 2, 2005 and it continued in wide use until February 23, 2008. Then the powers that be at COINSoft (you know who you are) made some major code changes, security changes and a complete overhaul of the database access routines in the phpCOIN v1.4.0 release, completely breaking the WHM Plug-In. A rewrite was required and Keith Holler picked up the torch and ran with it creating v1.4.0 (coded completely overnight) released on March 4, 2008 that was completely phpCOIN v1.4.0 compliant. With many fresh great ideas, combined with the new features added to cPanel/WHM since 2005, development continues.
- What the WHM Plug-In is:
- An interface within phpCOIN to perform basic server functions such as add, delete, suspend and unsuspend accounts using a remote access key within cPanel/WHM on the server
- A form of automation to automatically create new accounts based on payment completion using client/domain data collected during the order process by means of the built in API system in phpCOIN
- What the WHM Plug-In is NOT:
- It will not automatically suspend or unsuspend server accounts based on past due invoices (we are working on it though)
- It will not support more than one server at a time (we are working on that too)
- It will not make beds, change diapers, feed the cat or make coffee (sorry lightman)
How To Install
- Step 1: Completely Configure phpCOIN
-
- You must set your default server IP. This is the IP WHM Plug-In uses to access your server:
Admin -> parameters -> domains -> Domain Account Default IP Address
- Then make sure you have the server configured in:
Admin -> Server Info
If you don't have phpCOIN completely configured... WHM will not work properly. It depends on phpCOIN for all of its information.
- Step 2: Extract The Archive:
-
- Extract all files from the zip, making sure you maintain the folder structure.
- Copy the folder /coin_modules and the contents of that folder to your phpCOIN installation.
- Copy the folder /coin_lang and the contents of that folder to your phpCOIN installation.
- Copy the config_override.php file into your root coin folder. If you already have a config_override.php file, then add the line in ours to your own.
- If you have not made any changes to /coin_includes/api.php, replace the file on your website with /coin_includes/api.php from the whm add-on. If you have made changes, then compare the two files and insert the code found in the functions:
APIO_order_ret_proc APIO_domain_new APIO_domain_del
- The sql schema file and the instructions in the root folder of the zip do NOT need to be copied anywhere.
- Step 3: Modify the phpCOIN Database:
- Step 4: Configure the WHM Plug-In:
-
- In the file /coin_modules/whm/whm_admin.php in function do_get_remote_access_key() replace the contents of the variable $rak with your hash remote access key from WHM on your server. It can be found at: Cluster/Remote Access -> Setup Remote Access Key. Then save and close /coin_modules/whm/whm_admin.php
- Browse to Admin -> Parameters -> Group: ALL SubGroup: WHM and change the settings as necessary. (See the WHM Plug-In Parameters section below for details)
- Step 5: Match Your WHM Packages to phpCOIN Products:
-
- When you are logged-in as an administrator, browse to http://my.phpcoin.com/mod.php?mod=whm&mode=match_prods
- URLS for Usage: (Beginning in v1.4.3 these links will be added to the Administrator menu block during installation.)
-
- View at mod.php?mod=whm
- Quick Add at mod.php?mod=whm&mode=add
- To alter package matching in future: mod.php?mod=whm&mode=match_prods
- Step 1: Extract The Archive:
-
- Extract all files from the zip, making sure you maintain the folder structure.
- Copy the folder /coin_modules and the contents of that folder to your phpCOIN installation.
- Copy the folder /coin_lang and the contents of that folder to your phpCOIN installation.
- Copy the config_override.php file into your root coin folder. If you already have a config_override.php file, then add the line in ours to your own.
- If you have not made any changes to /coin_includes/api.php, replace the file on your website with /coin_includes/api.php from the whm add-on. If you have made changes, then compare the two files and insert the code found in the functions:
APIO_order_ret_proc APIO_domain_new APIO_domain_del
- The sql schema file and the instructions in the root folder of the zip do NOT need to be copied anywhere.
- Step 2: Configure the WHM Plug-In:
-
- In the file /coin_modules/whm/whm_admin.php in function do_get_remote_access_key() replace the contents of the variable $rak with your hash remote access key from WHM on your server. It can be found at: Cluster/Remote Access -> Setup Remote Access Key. Then save and close /coin_modules/whm/whm_admin.php
- Browse to Admin -> Parameters -> Group: ALL SubGroup: WHM and change the settings as necessary. (See the WHM Plug-In Parameters section below for details)
- Important Note:
- Step 3: Update Database (If Necessary):
-
- Log into cPanel and use phpMyAdmin to execute the queries in upgrade_to_14x.sql on your phpCOIN database. You do this by selecting your phpCOIN database in the left pane of phpMyAdmin.
and then click the SQL tab. Copy & paste the contents of the upgrade_to_14x.sql.sql file into the space provided and click go.

- Log into cPanel and use phpMyAdmin to execute the queries in upgrade_to_14x.sql on your phpCOIN database. You do this by selecting your phpCOIN database in the left pane of phpMyAdmin.
- Step 4: Match Your WHM Packages to phpCOIN Products:
-
- When you are logged-in as an administrator, browse to http://my.phpcoin.com/mod.php?mod=whm&mode=match_prods
- URLS for Usage: (Beginning in v1.4.3 these links will be added to the Administrator menu block during installation.)
-
- View at mod.php?mod=whm
- Quick Add at mod.php?mod=whm&mode=add
- To alter package matching in future: mod.php?mod=whm&mode=match_prods
- Check the path to Accounting.php.inc with your server administrator. By default it is /usr/local/cpanel/Cpanel/Accounting.php.inc
- Check that you do not have "open_basedir security" enabled for your account which can be changed in WHM --> Security Center --> PHP open_basedir Tweak --> then tick your domain name. Again, if you are having difficulty in locating or making this change, consult your server administrator.
How To Upgrade
Beginning in phpCOIN v1.4.0, the array value numbering changed in the domain status setting. They are now:
1 - n/a 2 - hosted 3 - parked 4 - other
If upgrading from 1.3.x to 1.4.x, you must change the setting in Admin -> Parameters -> Group: ALL SubGroup: WHM -> "Status of Domain to be in for the mod to compare" to 2 for hosted or 2 3 for hosted and parked domains for them to appear on the WHM page correctly. Of course you have to set the status on each domain accordingly.
WHM Plug-In Parameters
To access the WHM parameters, browse to:
Admin -> Parameters -> Group: ALL SubGroup: WHM
Beginning in v1.4.3 a wrench button was added to the end of the title and version that will take you straight to it without browsing through all of those pages.
The available settings are:
Check and report suspended accounts
If Yes, whm will attempt to report if an account is suspended or not. We've managed to get this to actually work with only one version of cPanel/WHM. They keep changing the status variables on us. If we can't get it to work consistently, this feature will be removed in future versions of the plug-in.
(Default: Yes)
Debug WHM
This will show extra details about WHM that will help determine common errors.
(Default: No)
Default path to home dir
When the account is not listed in phpCOIN or the dom_path is not set, this path will be used to determine if the account is suspended or not.
(Default: /home/%username%/public_html/)
Delete Domain from WHM when domain is deleted?
(Default: Yes)
Send Order Acknowledgement on WHM insert
Possible values: on/off
(Default: on)
Status of Domain to be in for the mod to compare
This is tied directly to the status field on the domain records in phpCOIN. Set this to the numeric representation of the statuses you would like WHM to use when pulling accounts from phpCOIN (1=n/a, 2=hosted, 3=parked & 4=other). You can separate more than one value with a space. (ie. 1 2 4)
(Default: 2)
WHM Auto Create on Order
Automatically create the account on the server when an order is returned successfully from the vendor paylink.
(Default: Yes)
WHM Host Domain (Depreciated)
This is the host address for WHM on your server. It can be localhost if the same server phpCOIN is running on or an IP address.
(Default: localhost)
Depreciated beginning in v1.4.3: WHM now points to the current default server used for domain account creation in phpCOIN. It will use the IP address stored in:
Admin -> parameters -> Group: common SubGroup: domains -> "Domain Account Default IP Address"
This will be one less parameter to set when installing the WHM Plug-In. A working install of phpCOIN should already be configured to the right server IP address... just set the WHM User parameter and paste the correct remote access key in whm_admin.php and you will be ready to rock-n-roll!
WHM User
This is the username to access WHM on your server used in conjunction with the remote access key to authenticate. Please note: If you are a reseller on someone else's server, your username will NOT be root. Please set it accordingly.
(Default: root)
WHM: Account file location
This is the path to your Accounting.php.inc file on your server. This include file contains all of the functions to perform the account actions. It is maintained by cPanel/WHM.
(Default: /usr/local/cpanel/Cpanel/Accounting.php.inc)
WHM: Number of domains on a page
This is the number of domains to show on a page when using the WHM View URL.
(Default: 25)
WHM: Variable to check upon order completion
This is the name of the variable that will either equal 1 or 0 when returning from a vendor paylink that you want to check before adding to WHM.
(Default: buy)
Troubleshooting
I just upgraded phpCOIN to a new version & the WHM Plug-In is broken
Whenever you upgrade phpCOIN, you will need to re-copy the files contained in the coin_includes directory that came with the WHM Plug-In package back into your phpCOIN installation. During upgrade, phpCOIN restores the generic files which removes the sections needed by the plug-in to function.
I get a blank page when loading any of the WHM Plug-In pages
The versions you are running are mismatched. WHM v1.3.4 is the old version and will only run on phpCOIN v1.3.1 and below. WHM v1.4.0 and above will only run on phpCOIN v1.4.0 and above. If you installed phpCOIN via Fantastico... you will definitely have to upgrade... at last report they were installing phpCOIN v1.2.5. Make sure you are running the most current version of phpCOIN and the newest version of the WHM Plug-In.
I get an accounting.php.inc error message
If you receive this error:
You will not be able to use this mod until you correct the path to the accounting.php.inc. Check to make sure /usr/local/cpanel/Cpanel/Accounting.php.inc is the correct path, and that you do not have open_basedir security in effect. Contact your host to allow access to this file.There are two possible steps to take:
Domains that I know are in phpCOIN are showing up as not in phpCOIN
You need to go into:
Admin -> Parameters -> Group: All SubGroup: WHM
and change "Status of Domain to be in for the mod to compare" to 2 for hosted or 2 3 for hosted and parked domains for them to appear on the WHM page correctly. Of course you also must set each domain accordingly.
I get a cPanel login box nested in my WHM Plug-In pages
The ONLY cause of this is your server is refusing your login. This can be caused by two things. Either your key is wrong and doesn't match the key set on the server in WHM, or you have the wrong "WHM: User" set in the parameters. If you own the server and it is dedicated to you... the default setting of root should work. If you are an account holder on someone else's server with reseller rights... it would be your account username... NOT root.
The login you are seeing is being injected into your page by your server. It is NOT coded into the WHM Plug-In. Double check the "WHM: User" setting in parameters and set it according to your situation. Then log into WHM on your server and the key is located in:
Cluster/Remote Access -> Setup Remote Access Key
Verify that it matches what you pasted in the WHM Plug-In whm_admin.php file. If not, re-paste it so that they match. It must be in that format and do NOT tab lines or edit it in any way. Whenever you click the regenerate key button on your server, you must paste the new one in whm_admin.php over the old one for the plug-in to continue talking to the server.
Bug Reports, Development Tracking & Wish List
To report a bug, take part in the development of the WHM Plug-In or to let us know what features you would like to see in future releases, visit http://bugs.azcappy.com. All are welcome!
Technical Support
All technical support is handled on the forums at http://forums.phpcoin.com. E-mails sent for support or posted in the bug tracking system will be ignored. We want to help as many users as possible. Someone out there is having the same problem you are having and will benefit from the solutions and ideas posted on the forums. Plus it saves us from answering the same question 5,000,000,000,000,000,000 times.

