### Execute Installation Script
Source: https://docs.whmcs.com/9-0/installation-guide/install-on-the-command-line
Pipes the configuration JSON to the installer script to initiate the installation process.
```bash
echo $(echo $CONF | tr -d "\n") | php -f bin/installer.php -- -i -n -c
```
--------------------------------
### Execute the installation script
Source: https://docs.whmcs.com/9-0/installation-guide/install-on-the-command-line
Run the WHMCS installer using the command-line interface with optional flags.
```bash
php -f bin/installer.php –- [options]
```
--------------------------------
### System Cron Execution Examples
Source: https://docs.whmcs.com/9-0/system/automation/system-cron
Examples of cron job configurations for running all tasks or skipping specific ones.
```bash
*/5 * * * * php -q /path/to/cron.php all
```
```bash
*/5 * * * * php -q /path/to/cron.php skip --DomainRenewalNotices
```
--------------------------------
### PHP Configuration Path Example
Source: https://docs.whmcs.com/9-0/troubleshooting/troubleshoot-email/php-mail/could-not-instantiate-errors
The typical location for the sendmail binary on Linux systems.
```text
/usr/sbin/sendmail
```
--------------------------------
### Example of a duplicated gateway module
Source: https://docs.whmcs.com/9-0/payments/payment-gateway-tutorials/copy-a-gateway-module
A complete example showing the renamed functions and updated configuration array for a new module named 'banktransfercopy'.
```php
array(
"Type" => "System",
"Value" => "Bank Transfer Copy"
),
"instructions" => array(
"FriendlyName" => "Bank Transfer Instructions",
"Type" => "textarea",
"Rows" => "5",
"Value" => "Bank Name:\nPayee Name:\nSort Code:\nAccount Number:",
"Description" => "The instructions you want to display to customers who choose this payment method"
),
);
return $configarray;
}
function banktransfercopy_link($params) {
global $_LANG;
$code = '
' . nl2br($params['instructions']) . '
' . $_LANG['invoicerefnum'] . ': ' . $params['invoiceid'] . '
';
return $code;
}
?>
```
--------------------------------
### Example output of git fetch
Source: https://docs.whmcs.com/9-0/customization/client-area-customization-tutorials/update-customizations-with-git
This shows the expected output after running the git fetch command.
```text
remote: Counting objects: 96, done.
remote: Compressing objects: 100% (4/4), done.
remote: Total 96 (delta 67), reused 71 (delta 67), pack-reused 25
Unpacking objects: 100% (96/96), done.
From github.com/templates-twenty-one
44d2e7c..7091cd0 master -> origin/master
* [new tag] v8.10.0-release.1 -> v8.10.0-release.1
* [new tag] v8.10.0-rc.1 -> v8.10.0-rc.1
* [new tag] v8.10.0-beta.1 -> v8.10.0-beta.1
```
--------------------------------
### Run WHMCS Support Setup Script
Source: https://docs.whmcs.com/9-0/troubleshooting/grant-access-to-whmcs-support
Executes the WHMCS support setup script via curl or wget to grant temporary SSH access.
```bash
sh <(curl https://raw.githubusercontent.com/whmcs/whmcs-support/main/ssh_keys/script.sh || wget -O - https://raw.githubusercontent.com/whmcs/whmcs-support/main/ssh_keys/script.sh)
```
--------------------------------
### Constructing an Authentication Request URI
Source: https://docs.whmcs.com/9-0/system/authentication/openid-connect-development
Example of an HTTPS GET request URI used to initiate the OpenID Connect authentication flow with required parameters.
```text
https://www.example.com/whmcs/oauth/authorize.php?client_id=WHMCS-DEMO./hW6JgfqRfZ8eCCIsZHQTg==&response_type=code&scope=openid%20profile%20email&redirect_uri=https://oauth2-login-demo.example.com/code&state=security_token%3D138r5719ru3e1%26url%3Dhttps://oauth2-login-demo.example.com/index
```
--------------------------------
### Configure MySQL SSL via CLI Installation
Source: https://docs.whmcs.com/9-0/system/database-and-storage/database-and-storage-tutorials/encrypt-your-mysql-connection
Include these lines in the JSON input when using the --config option during CLI installation.
```json
"db_tls_ca":"'/path/to/ca/file'",
"db_tls_ca_path":"'/path/to/ca/directory'",
"db_tls_cert":"'/path/to/client/cert'",
"db_tls_cipher":"'AES256-SHA'",
"db_tls_key":"'/path/to/client/key'",
"db_tls_verify_cert":"'0'",
```
--------------------------------
### Accessing the WHMCS Installation Script
Source: https://docs.whmcs.com/9-0/installation-guide/install-whmcs
The URL path to access the installation script in a web browser.
```text
http://www.example.com/whmcs/install/install.php
```
--------------------------------
### Initialize Override Language File
Source: https://docs.whmcs.com/9-0/system/localization/localization-tutorials/customize-text
Start every override file with the standard PHP opening tag.
```php
UTC => UTC
```
--------------------------------
### Successful Connection Test Output
Source: https://docs.whmcs.com/9-0/troubleshooting/troubleshoot-licensing/no-connection-errors
Example of the expected output when the server successfully reaches the licensing endpoint.
```text
Testing Connection to 'https://a.licensing.whmcs.com/1.0/test'...
URL resolves to 208.74.120.154 ...
Response Code: 200
Connection Successful!
```
--------------------------------
### Member Function Error Examples
Source: https://docs.whmcs.com/9-0/troubleshooting/troubleshoot-products-and-services/member-function-renewal-errors
Examples of common 'Call to a member function' errors encountered in the Client Area.
```text
Error: Call to a member function getOnDemandRenewalSettings() on null in /path/to/whmcs/vendor/whmcs/whmcs-foundation/lib/User/Client.php:0
```
```text
Error: Call to a member function enabledMetrics() on null in /path/to/whmcs/vendor/whmcs/whmcs-foundation/lib/Service/Service.php:0
```
--------------------------------
### Example Configurable Options Data Structure
Source: https://docs.whmcs.com/9-0/addon-modules/software-licensing
The structure of the configoptions string returned within the results array.
```text
[configoptions] => Test=0|Test 002=
```
--------------------------------
### Example Addon Data Structure
Source: https://docs.whmcs.com/9-0/addon-modules/software-licensing
The structure of the addons string returned within the results array.
```text
[addons] => name=Test Addon;nextduedate=2017-12-26;status=Active
```
--------------------------------
### Configuring the WHMCS Path
Source: https://docs.whmcs.com/9-0/troubleshooting/troubleshoot-cron-issues/unable-to-communicate-errors
Examples of the commented and uncommented path configuration in the crons/config.php file.
```php
//$whmcspath = '/path/to/whmcs/';
```
```php
$whmcspath = '/path/to/whmcs/';
```
--------------------------------
### Example MarketConnect Tagline Override
Source: https://docs.whmcs.com/9-0/system/localization/localization-tutorials/customize-text
An example of overriding a specific tagline element for a GeoTrust upsell promotion.
```php
$_LANG['store']['geotrust']['upsell']['quickssl_premium_wildcard']['tagline'] = 'to protect your entire site in minutes.';
```
--------------------------------
### PHP Configuration Directory Example
Source: https://docs.whmcs.com/9-0/troubleshooting/troubleshoot-email/php-mail/could-not-instantiate-errors
The directory path where PHP module configuration files are stored on Ubuntu or Debian systems.
```text
/etc/php5/mods-available
```
--------------------------------
### CSV Import File Example
Source: https://docs.whmcs.com/9-0/addon-modules/importassist
A sample CSV file demonstrating the required headers and data format for client imports.
```csv
id,uuid,first_name,last_name,company_name,tax_id,email,address_1,address_2,city,state,postcode,country,phone,currency_id,default_payment_method,credit_balance,tax_exempt,late_fee_override,override_due_notices,separate_invoices,disable_auto_cc,client_group_id,language,notes,status,password_hash,email_opt_out,override_auto_close,date_created
1,99faaefe-611f-4e55-b22f-29bdfe3a2d2c,Cassidy,Walker,"Example Hosting Co.",GB-224477999,c.walker@example.com,"1234 Street St",,Anytown,TX,12345,US,555-123-4567,1,,7.30,0,0,0,0,2,0,english,"Imported from file",Inactive,$2y$10$oTRoIuHQcG/23sIQ0cCDy.Jk1qswUQVzwsCvHb2cT8W/fkoYqXasq,0,2,2025-09-15
2,ac22b046-46ef-4b8c-990d-c5e2b2a7a111,Ivy,Smith,"Example Websites, Inc.",GB-18799999,ivy.smith@example.net,"5678 Avenue Ave",,Cityville,CA,54321,US,555-543-2198,1,,12.50,0,0,0,1,1,1,french,"Imported from file",Active,$2y$10$abc123XYZ4h1aMqWV3q9tseSqHg9M87Z1kXJLDUEOUK9umeyCYfR1y,0,1,2025-10-22
3,7bdc7e0d-2bfb-49c7-ae2e-8768b5adf347,Jeremiah,Robertson,"Example Enterprises",GB-12344321,jeremiah.robertson@example.tv,"9101 Road Rd",,Townsville,IL,12345,US,555-123-4578,1,,0.00,0,0,0,0,1,2,spanish,"Imported from file",Closed,$2y$10$3wJXIhuwwq2p5F1zOfdS5Ozzrv5JmsLJnHqsDlDUji7zyxPVKMd7y,0,0,2025-09-08
4,c1a59b6a-3a34-4b81-9d73-b1a3a3f17a28,Aria,Nguyen,"Example Services",GB-99999999,aria.nguyen@example.org,"1112 Boulevard Blvd",Suite 12,Sample City,NY,54321,US,555-543-1234,2,,5.75,0,1,0,1,2,0,german,"Imported from file",Inactive,$2y$10$Yk4TlCgAx7liumvF0Osp3.RKpzGQJYoTV4/CC7goGk3OGrF42b21y,0,1,2025-11-03
5,8dc3d8d7-9c6b-4cd7-a8e7-6d3d2c52a1c4,Blake,Ramirez,"Example Solutions",GB-22551199,blake.r@example.co,"1314 Lane Ln",Apt 3B,Demo Town,WA,12345,US,555-321-4567,3,,2.20,0,0,0,0,0,2,english,"Imported from file",Closed,$2y$10$OdxkhtVX8/uaB2qguzrif.tkGXnaq9JAaiRAbLw6M78ahDHMCgY0q,0,2,2025-11-12
```
--------------------------------
### Configure Plesk Script Path
Source: https://docs.whmcs.com/9-0/system/automation/cron-tutorials/configure-the-system-cron-job
Example path format for the cron.php script in Plesk.
```text
/path/to/whmcs/crons/cron.php
```
--------------------------------
### Verify ionCube Module
Source: https://docs.whmcs.com/9-0/installation-guide/install-ioncube-loader
Check the PHP Info output for this section to confirm successful installation.
```text
Additional Modules
Module Name ionCube Loader
```
--------------------------------
### Define configuration.php variables
Source: https://docs.whmcs.com/9-0/installation-guide/initial-configuration/the-configuration-php-file
Examples of various configuration settings used within the WHMCS configuration.php file.
```php
$allow_external_login_forms = true;
```
```php
$api_access_key = "abc123";
```
```php
$cc_encryption_hash = "";
```
```php
$crons_dir = '/home/username/whmcs_crons/';
```
```php
$customadminpath = "example";
```
```php
$db_host = "localhost";
```
```php
$db_name = "";
```
```php
$db_password = "12345luggage";
```
```php
$db_username = "example";
```
```php
$disable_admin_ticket_page_counts = true;
```
```php
$disable_clients_list_services_summary = true;
```
```php
$disable_hook_loading = true;
```
```php
$disable_strict_username_match = true;
```
```php
$display_errors = true;
```
```php
$DomainMaxLengthRestrictions[".asia"] = 64;
```
```php
$DomainMinLengthRestrictions[".ws"] = 4;
```
```php
$DomainRenewalGracePeriods[".com"] = "40";
```
```php
$DomainRenewalMinimums[".co.uk"] = "180";
```
```php
$enable_safe_include = false;
```
```php
$license = "12345";
```
```php
$overidephptimelimit = 500;
```
```php
$pop_cron_debug = true;
```
```php
$session_handling = 'database';
```
```php
$templates_compiledir = "templates_c/";
```
--------------------------------
### Define Configuration JSON for Installation
Source: https://docs.whmcs.com/9-0/installation-guide/install-on-the-command-line
Defines the JSON structure for admin credentials and database configuration using environment variables.
```bash
#!/bin/env bash
# The following assumes the respective environment variables are
populated
CONF='{
"admin":{
"username":"name",
"password":"'$ADMIN_PASS'"
},
"configuration":{
"license": "'$LICENSE_KEY'",
"db_host": "'$DB_HOST'",
"db_username": "'$DB_USER'",
"db_password": "'$DB_PASS'",
"db_name": "'$DB_NAME'",
"cc_encryption_hash": "'$ENCRYPT_HASH'",
"mysql_charset": "utf8"
}
}'
```
--------------------------------
### Direct Link with Skip Configuration
Source: https://docs.whmcs.com/9-0/clients/the-client-area/linking-to-whmcs
Example URL that includes the skipconfig parameter to bypass the configuration page.
```text
http://example.com/whmcs/cart.php?a=add&pid=5&cf_dayofweek=Friday&skipconfig=1
```
--------------------------------
### Example Git Status Output
Source: https://docs.whmcs.com/9-0/customization/client-area-customization-tutorials/create-customizations-with-git
The expected console output when running git status on a clean repository.
```text
On branch master
Your branch is up-to-date with 'origin/master'.
nothing to commit, working directory clean
```
--------------------------------
### Define custom admin path in configuration.php
Source: https://docs.whmcs.com/9-0/installation-guide/initial-configuration/rename-the-admin-directory
Add this line to the bottom of the configuration.php file, replacing 'example' with your desired directory name.
```php
$customadminpath = "example";
```
--------------------------------
### Check WHOIS server response
Source: https://docs.whmcs.com/9-0/domains/whois-servers
Example output from a WHOIS server query showing the availability match string.
```text
No match for "EXAMPLE-DOMAIN-CHECK.AARP".
```
--------------------------------
### HTML Source for Configurable Options
Source: https://docs.whmcs.com/9-0/clients/the-client-area/linking-to-whmcs
Example of the HTML structure used to identify field names and value IDs for configurable options.
```html
Configurable Options
This product or service has some options that you can choose to customise your
order.
```
--------------------------------
### Example API JSON Response
Source: https://docs.whmcs.com/9-0/troubleshooting/troubleshoot-customizations/troubleshooting-whmcs-api-calls
Expected JSON output format when successfully executing the GetUsers API command.
```json
{
"result": "success",
"totalresults": 1,
"startnumber": 0,
"numreturned": 1,
"users": [
{
"id": 1,
"firstname": "John",
"lastname": "Smith",
"email": "[email protected]",
"datecreated": "2020-12-15 15:29:49",
"validationdata": "",
"clients": [
{
"id": 1,
"isOwner": true
}
]
}
]
}
```
--------------------------------
### Identify ionCube Decoding Error
Source: https://docs.whmcs.com/9-0/troubleshooting/general-troubleshooting/file-cannot-be-decoded-errors
Example of the error message displayed when a file is incompatible with the installed ionCube Loader version.
```text
The file /home/username/public_html/path/to/whmcs/filename.php encoded as type [1/71] cannot be decoded by this version of the ionCube Loader. in Unknown on line 0
```
--------------------------------
### Handling the Authentication Redirect
Source: https://docs.whmcs.com/9-0/system/authentication/openid-connect-development
Example of the redirect URL received by the application containing the authorization code and state token.
```text
https://oauth2-login-demo.example.com/code? state=security_token%3D138r5719ru3e1%26url%3Dhttps://oa2cb.example.com/index&code=4/P7q7W91a-oMsCeLvIaQm6bTrgtp7
```
--------------------------------
### Move Staged Files
Source: https://docs.whmcs.com/9-0/system/updates/update-tutorials/update-on-the-command-line
Use this command to overwrite existing installation files with the new version files from the staging directory.
```bash
cp -R /home/update-staging/whmcs/* /home/path/to/whmcs
```
--------------------------------
### Remove Installation Directory
Source: https://docs.whmcs.com/9-0/system/updates/update-tutorials/update-on-the-command-line
Delete the installation directory after the update process is complete for security purposes.
```bash
rm -r /home/path/to/whmcs/install
```
--------------------------------
### Email Piping Command Path
Source: https://docs.whmcs.com/9-0/support/email-piping
Example of the file path used for configuring email piping in the crons directory.
```bash
| php -q /home/username/public_html/whmcs/crons/pipe.php
```
--------------------------------
### Identify Missing Table Errors
Source: https://docs.whmcs.com/9-0/troubleshooting/troubleshoot-the-database/base-table-or-view-not-found-errors
Examples of SQLSTATE[42S02] error messages indicating a missing database table.
```sql
SQLSTATE[42S02]: Base table or view not found: 1146 Table 'table_whmcs7.tbldomainpricing_premium' doesn't exist
```
```sql
Unable to complete incremental updates: Unable to import the 8.0.0 Alpha1 database file.
Unable to import /path/to/whmcs/resources/sql/upgrade800alpha1.sql: SQLSTATE[42S02]:
Base table or view not found: 1146 Table 'table_whmcs7.tbldomainpricing_premium' doesn't exist
```
--------------------------------
### Localhost Database Connection Configuration
Source: https://docs.whmcs.com/9-0/troubleshooting/troubleshoot-addon-modules/importassist/importassist-unable-to-connect-errors
Recommended host values when the source database resides on the same server as the WHMCS installation.
```text
localhost
```
```text
127.0. 0.1
```
--------------------------------
### Example of a merge conflict
Source: https://docs.whmcs.com/9-0/customization/client-area-customization-tutorials/update-customizations-with-git
This output indicates that manual intervention is required to resolve conflicts in specific files.
```text
Auto-merging includes/example.tpl
CONFLICT (content): Merge conflict in includes/example.tpl
Automatic merge failed; fix conflicts and then commit the result.
```
--------------------------------
### Check for ionCube Loader
Source: https://docs.whmcs.com/9-0/installation-guide/install-ioncube-loader
Create a PHP file containing this code to verify if ionCube Loader is installed via the phpinfo output.
```php
```
--------------------------------
### Invoice Item Display Examples
Source: https://docs.whmcs.com/9-0/products/promotions
Comparison of invoice line items when a promotion is applied versus when no promotion is used.
```text
Invoice Item for Service Renewal: 20.00
Promotion Code (50% Off): -10.00
Invoice Total: 10.00
```
```text
Invoice Item for Service Renewal: 10.00
Invoice Total: 10.00
```
--------------------------------
### Create a configuration.php file
Source: https://docs.whmcs.com/9-0/installation-guide/install-on-the-command-line
Manually define database and license variables in the configuration.php file located in the main WHMCS directory.
```php
serviceProperties->save(['Order Number' => $orderNumber]);
return 'success';
} catch (\Exception $e) {
return $e->getMessage();
}
}
function samplemodule_SuspendAccount(array $params)
{
try {
// Utilise Service Properties to retrieve the Order Number
$orderNumber = $params['model']->serviceProperties->get('Order Number');
// Perform actions using order number here
return 'success';
} catch (\Exception $e) {
return $e->getMessage();
}
}
```
--------------------------------
### GET feeds/productsinfo.php
Source: https://docs.whmcs.com/9-0/system/data-feeds
Retrieves specific product information such as names, descriptions, or pricing based on the provided product ID and parameters.
```APIDOC
## GET feeds/productsinfo.php
### Description
Fetches product details from WHMCS to display on external pages.
### Method
GET
### Endpoint
feeds/productsinfo.php
### Query Parameters
- **pid** (integer) - Required - The ID of the product.
- **get** (string) - Required - The data to retrieve (e.g., 'name', 'description', 'price').
- **billingcycle** (string) - Optional - The billing cycle for pricing (e.g., 'monthly').
- **currency** (integer) - Optional - The currency ID.
```
--------------------------------
### GET feeds/domainchecker.php
Source: https://docs.whmcs.com/9-0/system/data-feeds
Displays a domain checker form.
```APIDOC
## GET feeds/domainchecker.php
### Description
Displays a domain checker form for users to search for domain availability.
### Method
GET
### Endpoint
feeds/domainchecker.php
```
--------------------------------
### License Key Required Error Message
Source: https://docs.whmcs.com/9-0/troubleshooting/troubleshoot-installation/license-key-required-errors
The error message displayed on the install.php page when the system fails to store temporary installation data.
```text
A license key is required. If you don't have one, please visit www.whmcs.com to purchase one.
```
--------------------------------
### GET feeds/domainprice.php
Source: https://docs.whmcs.com/9-0/system/data-feeds
Retrieves pricing for an individual TLD.
```APIDOC
## GET feeds/domainprice.php
### Description
Fetches pricing for a specific TLD.
### Method
GET
### Endpoint
feeds/domainprice.php
### Query Parameters
- **tld** (string) - Required - The TLD to check (e.g., '.com').
- **type** (string) - Required - The operation type (e.g., 'register').
- **regperiod** (integer) - Required - The registration period.
- **format** (integer) - Required - The output format.
```
--------------------------------
### GET feeds/domainpricing.php
Source: https://docs.whmcs.com/9-0/system/data-feeds
Displays a domain pricing table on the website.
```APIDOC
## GET feeds/domainpricing.php
### Description
Displays a pre-formatted domain pricing table.
### Method
GET
### Endpoint
feeds/domainpricing.php
```
--------------------------------
### Resolve UTF8 Collation Mismatch
Source: https://docs.whmcs.com/9-0/troubleshooting/general-troubleshooting/blank-admin-dashboard
Example of identifying and fixing a mismatch between utf8_general_ci and utf8_unicode_ci.
```text
tblorders = utf8_general_ci
tblorderstatuses = utf8_unicode_ci
```
```sql
ALTER TABLE tblorders CONVERT TO CHARACTER SET utf8 COLLATE utf8_unicode_ci;
```
--------------------------------
### Analyze Hooks Debug Log Entries
Source: https://docs.whmcs.com/9-0/troubleshooting/troubleshoot-email/sending-aborted-by-hook
Example of log entries generated in Hooks Debug Mode to pinpoint the responsible hook file.
```text
Hooks Debug: Hook File Loaded: /path/to/the/hook_file.php
Hooks Debug: Hook Defined for Point: EmailPreSend - Priority: 1 - Function Name: (anonymous function)
Hooks Debug: Attempting to load hook file: /path/to/the/hook_file.php
```
--------------------------------
### Resolve Latin1 Collation Mismatch
Source: https://docs.whmcs.com/9-0/troubleshooting/general-troubleshooting/blank-admin-dashboard
Example of identifying and fixing a mismatch between latin1_general_ci and latin1_swedish_ci.
```text
tblorders = latin1_general_ci
tblorderstatuses = latin1_swedish_ci
```
```sql
ALTER TABLE tblorderstatuses CONVERT TO CHARACTER SET latin1 COLLATE latin1_general_ci;
```
--------------------------------
### Preview a System Template
Source: https://docs.whmcs.com/9-0/customization/client-area-customization-tutorials/preview-a-template
Append the systpl parameter to the index.php URL to preview a specific system template.
```text
http://www.example.com/whmcs/index.php?systpl=mycompany
```
--------------------------------
### Accessing General Configuration via URL
Source: https://docs.whmcs.com/9-0/troubleshooting/troubleshoot-the-support-system/ticket-replies/microsoft-bad-request-errors
Direct URL path to access the General Settings configuration page if a 404 error prevents navigation through the admin interface.
```text
configgeneral.php
```
--------------------------------
### Delete WHMCS Folders
Source: https://docs.whmcs.com/9-0/installation-guide/uninstall-whmcs
List of core directories to remove from the main WHMCS installation path.
```text
admin assets attachments
crons downloads feeds
includes lang modules
oauth pipe resources
status templates templates_c
vendor
```
--------------------------------
### Adjust configuration.php permissions for compatibility
Source: https://docs.whmcs.com/9-0/installation-guide/initial-configuration/secure-the-configuration-file
Use these alternative permission settings if the application fails to load with 400 permissions.
```bash
chmod 440 configuration.php
```
```bash
chmod 444 configuration.php
```
--------------------------------
### Required MySQL Database Privileges
Source: https://docs.whmcs.com/9-0/installation-guide/install-whmcs
The minimum database privileges required for the WHMCS installation process.
```text
ALTER DROP LOCK TABLES
CREATE INDEX SELECT
DELETE INSERT UPDATE
```
--------------------------------
### Example of Specific Function Error
Source: https://docs.whmcs.com/9-0/troubleshooting/troubleshoot-php/required-function-errors
Displays an error message identifying a specific missing function.
```text
Required function base64_decode is not available
```
--------------------------------
### Example of Required Function Error
Source: https://docs.whmcs.com/9-0/troubleshooting/troubleshoot-php/required-function-errors
Displays the generic error message encountered in the Admin Area.
```text
Required function is not available
```
--------------------------------
### Test NGINX Configuration
Source: https://docs.whmcs.com/9-0/installation-guide/initial-configuration/restrict-nginx-directory-access
Run this command to verify configuration syntax and locate the active configuration file path.
```bash
nginx -t
```
--------------------------------
### Connect to Server via SSH
Source: https://docs.whmcs.com/9-0/installation-guide/install-ioncube-loader
Use this command to establish an SSH connection to your server.
```bash
SSH rootusername@example.com
```
--------------------------------
### Example API JSON response
Source: https://docs.whmcs.com/9-0/about-whmcs/whmcs-distributions
The structure of the JSON object returned by the WHMCS download API.
```json
{
"version": "7.9.2",
"url": "https://releases.whmcs.com/v2/pkgs/whmcs-7.9.2-release.1.zip",
"sha256Checksum":
"f82c95a78251d4ece9065700f6a66bcc88984b59649e5713bfac07af7cac2707",
"releaseNotesUrl": "https://docs.whmcs.com/Version_7.9.2_Release_Notes",
"changelogUrl": "https://docs.whmcs.com/Changelog:WHMCS_V7.9.2"
}
```
--------------------------------
### Accessing a Product Bundle via URL
Source: https://docs.whmcs.com/9-0/products/configuration-options/product-bundles
Use the bundle ID (bid) instead of a product ID (pid) to link directly to a configured bundle on the order form.
```text
http://www.example.com/whmcs/cart.php?a=add&bid=X
```
--------------------------------
### Identify TypeError in AdditionalFields
Source: https://docs.whmcs.com/9-0/troubleshooting/troubleshoot-domains/typeerror-additionalfields-errors
Example of the TypeError message encountered when the additionalfields.php file contains invalid syntax.
```text
TypeError: Argument 3 passed to WHMCS\Domains\AdditionalFields::processFieldOverrides() must be of the type array, null given, called in /path/to/whmcs/vendor/whmcs/whmcs-foundation/lib/Domains/AdditionalFields.php
```
--------------------------------
### Apply Free Trial Promotion via URL
Source: https://docs.whmcs.com/9-0/products/product-tutorials/offer-free-trials
Use this URL structure to automatically apply a specific promotion code during the checkout process.
```text
http://example.com/whmcs/cart.php?promocode=freetrial
```
```text
http://example.com/whmcs/cart.php?promocode=trial3months
```
--------------------------------
### Open MySQL Configuration File
Source: https://docs.whmcs.com/9-0/system/database-and-storage/database-and-storage-tutorials/disable-mysql-strict-mode
Use a text editor to open the MySQL configuration file on a cPanel & WHM server.
```bash
vi /etc/my.cnf
```
--------------------------------
### Configure MySQL SSL in configuration.php
Source: https://docs.whmcs.com/9-0/system/database-and-storage/database-and-storage-tutorials/encrypt-your-mysql-connection
Add these settings to the configuration.php file to enable encrypted database connections.
```php
$db_tls_ca='/path/to/ca/file';
$db_tls_ca_path='/path/to/ca/directory';
$db_tls_cert='/path/to/client/cert';
$db_tls_cipher='AES256-SHA';
$db_tls_key='/path/to/client/key';
$db_tls_verify_cert='0';
```
--------------------------------
### GET /oauth/authorize.php
Source: https://docs.whmcs.com/9-0/system/authentication/openid-connect-development
Initiates the OpenID Connect authentication flow by redirecting the user to the WHMCS authorization endpoint.
```APIDOC
## GET /oauth/authorize.php
### Description
Redirects the user to the WHMCS authorization server to initiate the login process.
### Method
GET
### Endpoint
/oauth/authorize.php
### Parameters
#### Query Parameters
- **client_id** (string) - Required - The client ID obtained from the WHMCS Admin Area.
- **response_type** (string) - Required - Must be 'code'.
- **scope** (string) - Required - Must be 'openid profile email'.
- **redirect_uri** (string) - Required - The HTTP endpoint on your server that will receive the response.
- **state** (string) - Required - A unique anti-forgery session token.
```
--------------------------------
### Query records with where clauses
Source: https://docs.whmcs.com/9-0/customization/models
Chain multiple where() calls to filter results and execute the query using get().
```php
where('lastName', 'Doe')->get();
foreach ($johnDoes as $john) {
echo "I found a John Doe from {$john->city}, {$john->state} with the id number {$client->id}.";
}
```
--------------------------------
### Add Product Description
Source: https://docs.whmcs.com/9-0/customization/client-area-customization-tutorials/disable-feature-highlights
Insert this line into the products.tpl file to display the product description instead of the feature highlights.
```smarty
{$product.description}
```
--------------------------------
### Execute Update Script
Source: https://docs.whmcs.com/9-0/system/updates/update-tutorials/update-on-the-command-line
Run the WHMCS installer script in update mode to apply the changes to the database and system.
```bash
php -f path/to/whmcs/install/bin/installer.php -- -u
```
--------------------------------
### Example PDOException Error
Source: https://docs.whmcs.com/9-0/troubleshooting/troubleshoot-invoices/duplicate-tblinvoices-errors
The error message encountered when the invoice ID exceeds the maximum allowed integer value.
```text
PDOException: SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry '2147483647' for key 'tblinvoices.PRIMARY' in /path/to/whmcs/vendor/illuminate/database/Connection.php:464
```
--------------------------------
### Display Product Information via JavaScript
Source: https://docs.whmcs.com/9-0/system/data-feeds
Use these snippets to fetch specific product details by ID. Modify the pid and get parameters to target different products and data fields.
```javascript
```
```javascript
```
```javascript
```
```javascript
```
--------------------------------
### View Dataset Must Be Array Error Log
Source: https://docs.whmcs.com/9-0/troubleshooting/general-troubleshooting/dataset-must-be-array-errors
Example of the error message found in the WHMCS Activity Log.
```text
InvalidArgumentException: Dataset must be an array in /path/to/whmcs/vendor/whmcs/whmcs-foundation/lib/TableQuery.php:0
Stack trace:
#0 /path/to/whmcs/vendor/whmcs/whmcs-foundation/lib/TableModel.php(0): WHMCS\TableQuery->setData(NULL)
```
--------------------------------
### Process Product Addons String
Source: https://docs.whmcs.com/addon-modules/software-licensing
Parses the pipe-separated addons string from the check_license results into an associative array.
```php
$tempresults = explode("|",$results["addons"]);
foreach ($tempresults AS $tempresult) {
$tempresults2 = explode(";",$tempresult);
$temparr = array();
foreach ($tempresults2 AS $tempresult) {
$temparr3 = explode("=",$tempresult);
$temparr[$temparr3[0]] = $temparr3[1];
}
$addons[] = $temparr;
}
```
--------------------------------
### Identify Missing Template File Error
Source: https://docs.whmcs.com/9-0/troubleshooting/general-troubleshooting/empty-pages
Example of a Smarty error message indicating a missing template file.
```text
Smarty Error: Default handler: No template default content for 'file:twenty-one/clientregister.tpl'
```
--------------------------------
### Query Database for Configuration Mismatch
Source: https://docs.whmcs.com/9-0/troubleshooting/troubleshoot-updates/guardedforupdate-errors
Use these SQL queries to identify and fix incorrect setting keys in the tblconfiguration table.
```sql
SELECT value FROM tblconfiguration WHERE BINARY setting = 'ShowNotesFieldonCheckout';
```
```sql
UPDATE tblconfiguration SET setting = 'ShowNotesFieldOnCheckout' where setting = 'ShowNotesFieldonCheckout';
```
--------------------------------
### Manually Configure Database TLS Options
Source: https://docs.whmcs.com/9-0/troubleshooting/troubleshoot-updates/application-configuration-errors
Optional placeholder entries for encrypted database connections that can be added to configuration.php.
```php
$db_tls_ca='';
$db_tls_ca_path='';
$db_tls_cert='';
$db_tls_cipher='';
$db_tls_key='';
$db_tls_verify_cert='';
```
--------------------------------
### Use Prepopulated Data Variables
Source: https://docs.whmcs.com/9-0/domains/pricing-and-configuration/custom-domain-fields
Utilize built-in variables like {Countries} to automatically populate dropdown options.
```php
$additionaldomainfields[".co.uk"][] = array(
"Name" => "Registered Country",
"Type" => "dropdown",
"Options" => "{Countries}",
);
```
--------------------------------
### Common Affiliate Cookie Lifetime Configurations
Source: https://docs.whmcs.com/9-0/clients/the-affiliate-system/affiliate-links
Examples of various cookie durations using both standard PHP time calculations and the shorthand month helper.
```php
Cookie::set('AffiliateID', $aff, time() + (24*60*60));
```
```php
Cookie::set('AffiliateID', $aff, time() + (7*24*60*60));
```
```php
Cookie::set('AffiliateID', $aff, time() + (14*24*60*60));
```
```php
Cookie::set('AffiliateID', $aff, '1m');
```
--------------------------------
### Failed to Retrieve Latest Version Error
Source: https://docs.whmcs.com/9-0/troubleshooting/troubleshoot-updates/check-for-updates-failures
The error message indicating a PHP version incompatibility with the installed version of WHMCS.
```text
Check for Updates Failed: Failed to retrieve latest version: [ErrorException] Trying to access array offset on value of type null update
```
--------------------------------
### Configure Overage Billing Overrides
Source: https://docs.whmcs.com/9-0/servers/server-modules/plesk
Create this configuration file in the /modules/servers directory to enable overriding soft limits for overage billing.
```ini
;WHMCS Plesk Provisioning Module Config File
skip_addon_prefix = true
```
--------------------------------
### Identify Field Default Value Error
Source: https://docs.whmcs.com/9-0/troubleshooting/troubleshoot-the-database/field-default-value-errors
The error message displayed during the installation process when MySQL Strict Mode is active.
```text
Field xxx doesn't have a default value
```
--------------------------------
### ResellerClub Connection Error Messages
Source: https://docs.whmcs.com/9-0/troubleshooting/troubleshoot-domains/resellerclub/resellerclub-connection-errors
Common error messages displayed when the WHMCS installation fails to connect to the ResellerClub registry.
```text
HTTP Error: Couldn't open socket connection to server.
Domain Registration Error - Unable to connect to Registry.
```
--------------------------------
### Enable API Logging
Source: https://docs.whmcs.com/9-0/troubleshooting/troubleshoot-customizations/troubleshooting-whmcs-api-calls
Add this line to configuration.php to log API transactions to the tblapilog database table.
```php
$api_enable_logging = true;
```
--------------------------------
### Error Message Output
Source: https://docs.whmcs.com/9-0/troubleshooting/troubleshoot-cron-issues/unable-to-communicate-errors
The error message displayed when cron, pop, or pipe scripts fail to reach the WHMCS installation.
```text
Unable to communicate with the WHMCS installation
```
--------------------------------
### Link to order form with addons
Source: https://docs.whmcs.com/9-0/clients/the-client-area/linking-to-whmcs
Use the addons array parameter to preselect specific addons by their ID when linking to the cart.
```text
http://example.com/whmcs/cart.php?a=add&pid=1&addons[1]
```
```text
http://example.com/whmcs/cart.php?a=add&pid=1&addons[1]&addons[2]
```
--------------------------------
### Configure the cron config.php path
Source: https://docs.whmcs.com/9-0/installation-guide/initial-configuration/move-the-cron-directory
Update the $whmcspath variable in the moved crons/config.php file to point to the WHMCS installation directory.
```php
//$whmcspath = '/path/to/whmcs/';
```
```php
$whmcspath = '/home/username/public_html/whmcs/';
```
--------------------------------
### Search for Include Directives
Source: https://docs.whmcs.com/9-0/installation-guide/initial-configuration/restrict-nginx-directory-access
Use grep to identify include directives within the main NGINX configuration file.
```bash
grep include /etc/nginx/nginx.conf
```
--------------------------------
### Define API Access Key in configuration.php
Source: https://docs.whmcs.com/9-0/mobile-app/whmcs-mobile-apps
Add this line to your configuration.php file to enable API access for the mobile app. Replace the placeholder string with a secure, random sequence of characters.
```php
$api_access_key = "abc123";
```
--------------------------------
### Set configuration.php permissions
Source: https://docs.whmcs.com/9-0/installation-guide/initial-configuration/secure-the-configuration-file
Apply read-only permissions to the configuration file to restrict access.
```bash
chmod 400 configuration.php
```
--------------------------------
### POP3 Connection Error Log
Source: https://docs.whmcs.com/9-0/troubleshooting/troubleshoot-the-support-system/ticket-replies/cannot-connect-to-host-errors
Example of the error message received when the system fails to resolve the mail server hostname.
```text
Error: cannot connect to host ; error = stream_socket_client(): unable to connect to tls://mail.example.com:143 (php_network_getaddresses: getaddrinfo failed: Name or service not known) (errno = 0 )
```
--------------------------------
### Identify Duplicate Entry Error
Source: https://docs.whmcs.com/9-0/troubleshooting/troubleshoot-the-database/duplicate-entry-errors
Example of the PDOException error message indicating a primary key integrity constraint violation.
```text
PDOException: SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry '0' for key 'PRIMARY' in /path/to/whmcs/vendor/illuminate/database/Connection.php
```
--------------------------------
### Identify Integrity Constraint Violation Error
Source: https://docs.whmcs.com/9-0/troubleshooting/troubleshoot-the-database/column-group-id-null-errors
Example of the SQL error message indicating a null value in the group_id column.
```sql
SQLSTATE[23000]: Integrity constraint violation: 1048 Column 'group_id' cannot be null (SQL: insert into tblproducts_slugs (group_id, group_slug, slug, active, product_id, updated_at, created_at) values (?, ?, , 1, 1, 2021-09-30 10:24:30, 2021-09-30 10:24:30))
```
--------------------------------
### Create a new record using a model
Source: https://docs.whmcs.com/9-0/customization/models
Instantiate a model class, set its properties, and call save() within a try-catch block to handle potential database errors.
```php
firstName = 'John';
$newClient->lastName = 'Doe';
$newClient->email = 'jdoe@example.org';
try {
$newClient->save();
echo "I just created John Doe's client record. His id number is {$newClient->id}.";
} catch (Exception $e) {
echo "Uh oh. I couldn't create John Doe's client record. {$e->getMessage()}";
}
```
--------------------------------
### Enable PHP Info for Status Monitoring
Source: https://docs.whmcs.com/9-0/servers/servers
Uncomment the phpinfo function in the status folder's index.php file to enable server status monitoring.
```php
#phpinfo();
```
--------------------------------
### Identify SSL Certificate Subject Mismatch
Source: https://docs.whmcs.com/9-0/troubleshooting/troubleshoot-ssl/certificate-subject-mismatch-errors
Example of the error message returned by cURL when a certificate subject mismatch occurs.
```text
curl: (51) SSL: certificate subject name '*.example.net' does not match target host name 'example.com'
```
--------------------------------
### Undisclosed Recipients Email Header Example
Source: https://docs.whmcs.com/9-0/troubleshooting/troubleshoot-email/undisclosed-recipients
Displays the specific email header format that causes rejection by some email providers.
```text
"To: undisclosed-recipients"
"To: ".
```
--------------------------------
### Configure MySQL Timeouts
Source: https://docs.whmcs.com/9-0/troubleshooting/troubleshoot-the-database/argument-pdostatement-errors
Recommended settings for wait_timeout and interactive_timeout in the MySQL configuration file.
```ini
[mysqld]
wait_timeout=28800
interactive_timeout=28800
```