Install On The Command Line

From WHMCS Documentation

Revision as of 12:25, 4 May 2020 by SarahK (talk | contribs)

Installing from the command line

In addition to our other methods, you can install and upgrade WHMCS on the command line. This is useful when you provision WHMCS for multiple installations. To use this method of installation, you must first download the .zip file for the desired version of WHMCS and unzip it.

For advanced users

  • We only recommend this method for advanced users who are familiar with database management and the command line.
  • Configuration and database issues can prevent you from using this method. We recommend that you perform a backup first.
  • This installation method doesn't perform checks for InnoDB or database setup.

Input

The installation script uses the following syntax:

php -f bin/installer.php –- [options]

Options

Defaults
The script enables non-interactive mode (-n or --non-interactive) and performs an upgrade (-u or --upgrade) by default.

You can use these options with the installation script:

Option Description
-c or --config Provide configuration data in the JSON format. Use this with the -n or --non-interactive option.

For more on how to use this, see Supplying configuration data below.

Added in WHMCS 7.10
We added this option in WHMCS version 7.10.
-h or --help View help information.
-i or --install Perform a new installation.
-n or --non-interactive Don't require user input while the script runs.
-s or --status Provide status information about the installation's files and databases.
-u or --upgrade Upgrade an existing installation.
-v or --verbose Run the script with verbose output.

Supplying configuration data

If you use the -c or --config option, you must supply configuration data in the JSON format. For example:

echo '{"admin":{"username":"name","password":"12345luggage"}}' | php -f bin/installer.php – -i -n -c

The script uses your input to create a configuration.php file for the installation.

You can configure two arrays:

Array Description
admin Provide information for the installation's administrator account using the username and password parameters.

Warning
Exercise caution using the admin array to supply passwords. It could pose a security risk.

configuration Provide configuration information for the WHMCS installation. For a list of parameters to use, see Restoring WHMCS.