We have a new documentation site for cPanel & WHM! You can find our new documentation site at docs.cpanel.net.

We will continue to maintain our API documentation on this server.

Child pages
  • UAPI Functions - Variables::get_server_information
Skip to end of metadata
Go to start of metadata

Description

This function retrieves the configuration settings for the cPanel & WHM server on which an account exists. This is useful, for example, to verify which applications and functionality are available on the account.

Examples


 cPanel or Webmail Session URL
https://hostname.example.com:2083/cpsess##########/execute/Variables/get_server_information?name-1=disable_analog&name-2=display_cpanel_doclinks&name-3=docroot



Note:

This example calls the UAPI function via a cPanel session. For more information, read our Guide to UAPI documentation. 

 LiveAPI PHP Class
$cpanel = new CPANEL(); // Connect to cPanel - only do this once.
 
//Retrieve server settings for example.com.
$variables = $cpanel->uapi(
    'Variables', 'get_server_information',
    array(
        'name-1' => 'disable_analog',
		'name-2' => 'display_cpanel_doclinks',
		'name-3' => 'docroot',
        )
);


Note:

For more information, read our Guide to the LiveAPI System.

 LiveAPI Perl Module
my $cpliveapi = Cpanel::LiveAPI->new(); # Connect to cPanel - only do this once.
 
# Retrieve user settings for example.com.
my $variables = $cpliveapi->uapi(
    'Variables', 'get_server_information',
    {
        'name-1' => 'disable_analog',
		'name-2' => 'display_cpanel_doclinks',
		'name-3' => 'docroot',
    }
);


Note:

For more information, read our Guide to the LiveAPI System.

 Command Line
uapi --user=username Variables get_server_information name-1=disable_analog name-2=display_cpanel_doclinks name-3=docroot


Notes:

  • You must URI-encode values.
  • username represents your account-level username.
  • For more information and additional output options, read our Guide to UAPI documentation or run the uapi --help command. 
  • If you run CloudLinux™, you must use the full path of the uapi command:

    /usr/local/cpanel/bin/uapi


 Output (JSON)
{
	"messages": null,
	"errors": null,
	"status": 1,
	"metadata": {

	},
	"data": {
		"disable_analog": "1",
		"display_cpanel_doclinks": "1",
		"docroot": "/usr/local/cpanel/base"
	}
}


Note:

Use cPanel's API Shell interface (cPanel >> Home >> Advanced >> API Shell) to directly test cPanel API calls.

Parameters

ParameterTypeDescriptionPossible valuesExample
namestring

The server configuration settings to return.

Note:

To retrieve multiple variables, increment this parameter. For example, name-1=variable, name-2=variable, name-3=variable.

If you don't use this parameter, this function returns all of the server's configuration settings. 


 Click to view...
  • allow_park_subdomain_on_hostname

  • allow_remote_domains
  • allow_reset_password
  • allow_reset_password_for_subaccounts
  • allow_unregistered_domains
  • apache_port
  • apache_ssl_port
  • api_shell
  • awstats_browser_update
  • awstats_reverse_dns
  • cpanel_root_directory
  • database_prefix_required
  • default_theme
  • disable_analog
  • disable_awstats
  • disable_boxtrapper
  • disable_mailman
  • disable_roundcube
  • disable_spamassassin
  • disable_spambox
  • disable_webalizer
  • display_cpanel_doclinks
  • dns_admin_app
  • domains_in_public_html_only
  • email_filter_storage_directory
  • empty_trash_days
  • enable_file_protect
  • file_upload_maximim_bytes
  • file_upload_must_leave_bytes
  • file_usage
  • ftp_server
  • htaccess_check_recurse
  • invite_sub
  • is_moduserdir_enabled 
  • local_nameserver_type
  • logout_redirect_url
  • mailbox_storage_format
  • mail_server
  • minimum_password_strength
  • minimum_password_strength_mysql
  • mysql_host
  • mysql_version
  • php_maximum_execution_time
  • php_post_maximum_size
  • php_system_default_version
  • php_upload_maximum_filesize
  • php_loader
  • php_open_base_dir_home
  • phpmyadmin_disable_search_info_schema
  • process_pop_before_smtp
  • process_pop_before_smtp_senders
  • require_ssl
  • skip_apache_clients_optimizer
  • use_email_for_mailman_url
  • use_information_schema
  • version
access_log 

Returns

Note:

For more information about each return, read our The cpanel.config File documentation.


ReturnTypeDescriptionPossible values

Example

allow_park_subdomain_on_hostnameBoolean

Whether the system allows users to park subdomains of the server's hostname.

  • 1 — Allows.
  • 0 — Doesn't allow.
0
allow_remote_domainsBoolean

Whether the system allows users to create addon domains or aliases that resolve to other servers.

  • 1 — Allows.
  • 0 — Doesn't allow.
0
allow_reset_password BooleanWhether cPanel's Reset Password feature is enabled for the account.
  • 1 — Reset Password feature enabled.
  • 0 — Reset Password feature not enabled.
0 
allow_reset_password_for_subaccounts BooleanWhether cPanel's Reset Password feature is enabled for subaccounts on the account.
  • 1 — Reset Password feature enabled.
  • 0 — Reset Password feature not enabled.
0 
allow_unregistered_domainsBoolean

Whether the system allows users to add domains they didn't register with a domain name registrar.

  • 1 — Allows.
  • 0 — Doesn't allow.
0
apache_portstringThe port or IP address that Apache uses to listen for requests and serve web pages over an unsecured connection.
  • A valid IP address.
  • An IP address with a firewall port. 
192.0.2.0 
apache_ssl_portstringThe port or IP address that Apache uses to listen for requests and serve web pages over a secure connection.
  • A valid IP address.
  • An IP address with a firewall port. 
192.0.2.0:443
api_shellBooleanWhether the user can access cPanel's API Shell interface (cPanel >> Home >> Advanced >> API Shell).
  • 1 — Can access.
  • 0 — Can't access.
0
awstats_browser_updateBoolean

Whether the user can update their AWstats software.

  • 1 — Can update.
  • 0 — Can't update.
0
awstats_reverse_dnsBoolean

Whether the AWstats statistical analysis program interprets visitors' domain names as IP addresses.

  • 1 — Interprets visitors' domain names as IP addresses.
  • 0 — Doesn't interpret visitors' domain names as IP addresses.
0
cpanel_root_directorystring

The cPanel root directory.

A valid directory path./usr/local/cpanel
database_prefix_requiredBoolean

Whether the account requires database prefixing. 

  • 1 — Requires database prefixing.
  • 0 — Doesn't require database prefixing.
1
default_theme stringThe cPanel interface's default theme.A valid cPanel theme.paper_lantern 
disable_analog Boolean

Whether Analog Stats are enabled.

  • 1 — Enabled.
  • 0 — Not enabled.
1 
disable_awstats Boolean

Whether the AWStats program is enabled.

  • 1 — Enabled.
  • 0 — Not enabled.
1 
disable_boxtrapper BooleanWhether the BoxTrapper spam trap is enabled.
  • 1 — Enabled.
  • 0 — Not enabled.
1 
disable_horde BooleanWhether Horde Webmail is enabled.
  • 1 — Enabled.
  • 0 — Not enabled.
1 
disable_mailman Boolean

Whether Mailman mailing lists are enabled.

  • 1 — Enabled.
  • 0 — Not enabled.
1 
disable_roundcube Boolean

Whether Roundcube Webmail is enabled.

  • 1 — Enabled.
  • 0 — Not enabled.
1 
disable_spamassassin Boolean

Whether the Apache SpamAssassin™ spam filter is enabled.

  • 1 — Enabled.
  • 0 — Not enabled.
1 
disable_spambox Boolean

Whether Apache SpamAssassin’s spam box feature is enabled.

  • 1 — Enabled.
  • 0 — Not enabled.
1 
disable_webalizer BooleanWhether the Webalizer statistics program is enabled.
  • 1 — Enabled.
  • 0 — Not enabled.
1 
display_cpanel_doclinksBoolean

Whether the system displays links to cPanel feature documentation in the cPanel interface.

  • 1 — Displays documentation links.
  • 0 — Doesn't display documentation links.
0
dnsadmin_appstring

The application that processes DNS management requests.

  • An application's file path, relative to the user's home directory.
  • dnsadmin, auto-detect SSL

undef


docroots_in_public_html_only Boolean

Whether the system restricts users from creating addon domains and subdomains outside of their public_html directory.

  • 1 — Restricts users from creating addon domains and subdomains outside of their public_html directory.
  • 0  — Allows users to creating addon domains and subdomains outside of their public_html directory.
1 
email_filter_storage_directory stringThe location of the Exim email filter storage directory.A valid directory path./etc/vfilters
empty_trash_daysstring

The minimum age of files that the system will automatically purge from .trash folders in user home directories.

  • An integer value.
  • Not enabled 
Not enabled
enable_file_protectBoolean

Whether EasyApache 4's FileProtect option is enabled.

  • 1 — Enabled.
  • 0 — Not enabled.
1
file_upload_maximum_bytesintegerThe maximum file size, in Megabytes, that a user can upload to a server.An integer between 1 and 10240 

1


file_upload_must_leave_bytesintegerThe minimum filesystem quota space that the system requires after a file uploads to your server.A positive integer.5
file_usageBoolean

Whether file usage information displays in the cPanel Home interface's statistics bar.

  • 1 — Displays file usage information.
  • 0 — Doesn't display file usage information.
0
ftp_serverstring

The FTP server. 

  • pure-ftpd
  • pro-ftp 

pure-ftpd

htaccess_check_recurseintegerThe maximum number of directories deep to look for .htaccess files when you change the PHP handler.An integer value.2
invite_subBoolean

Whether cPanel account users can send invitations to new Subaccount users via cPanel's User Manager interface (cPanel >> Home >> Preferences >> User Manager).

  • 1 — Can send invitations.
  • 0 — Can't send invitations.
1
is_mod_userdir_enabled BooleanWhether the mod_userdir tweak is enabled.
  • 1 — Enabled.
  • 0 — Not enabled.
0 
local_nameserver_typestring

The DNS nameserver's type.

  • bind 
  • powerdns
  • Not enabled  

bind

logout_redirect_urlstring

The logout redirection URL.

A valid URL.

http://example.com

mailbox_storage_formatstring

The storage format for new accounts.

  • mdbox
  • maildir
maildir
mail_serverstring

The mailserver type.

  • horde 
  • dovecot 

dovecot

minimum_password_strengthinteger

The minimum strength for cPanel account passwords. 

An integer value.

65

minimum_password_strength_mysql

integerThe minimum strength for MySQL® or MariaDB® passwords. An integer value.65 
mysql_host stringThe MySQL or MariaDB host. A valid MySQL server's IP address or hostname.localhost
mysql_versionstring

The MySQL or MariaDB version.

Note:

If the server runs MariaDB instead of MySQL, the function will return a value of 10.0 or greater.

  • 5.6 
  • 5.7 
  • 8.0
  • 10.0
  • 10.1
  • 10.2
  • 10.3

5.7

php_maximum_execution_timeinteger

The number of seconds that a PHP script can run before the system terminates it.

An integer value.90
php_post_maximum_sizeinteger

The maximum size, in Megabytes (MB), of a POST request.

An integer value55
php_system_default_versionstring

The system's default version of PHP. 

A PHP version.ea-php56
php_upload_maximum_filesizeinteger

The maximum file size, in Megabytes (MB), that a PHP script may upload.

An integer value.50
php_loaderstring

The PHP loader or loaders through which the system executes internal PHP scripts.

  • ioncube 
  • sourceguardian 
ioncube
php_open_basedir_homeBoolean

Whether the PHP open_basedir tweak is enabled on the server. 

Important:

In cPanel & WHM version 78, we removed WHM's PHP open_basedir Tweak interface (WHM >> Home >> Security Center >> PHP open_basedir Tweak).

  • 1 — Enabled.
  • 0 — Not enabled.
0
phpmyadmin_disable_search_info_schemaBoolean

Whether the user can search for phpMyAdmin information schema.

  • 1 — Searches are enabled.
  • 0 — Searches are Not enabled.
0
require_sslBoolean

Whether the system requires passwords and other sensitive information use SSL encryption.

  • 1 — Requires SSL.
  • 0 — Doesn't require SSL.
1
skip_apache_clients_optimizerBooleanWhether the Apache Client Optimizer is enabled. 
  • 1 — Enabled.
  • 0 — Not enabled.
0
skip_bandwidth_limit_check BooleanWhether the system automatically suspends HTTP service for accounts that exceed their bandwidth limit.
  • 1 — Suspends HTTP service.
  • 0 — Doesn't suspend HTTP service.
0 
skip_mailbox_warnings_check BooleanWhether mailbox usage warnings are enabled.
  • 1 — Enabled.
  • 0 — Not enabled.
1 
use_mail_for_mailman_urlBooleanWhether the system prefixes Mailman URLs with mail. For example, http://mail.domain.com/mailman.
  • 1 — Prefixes Mailman URLs with mail.
  • 0 — Doesn't prefix Mailman URLs with mail.
0 
use_information_schemaBoolean

Whether the system uses the MySQL® INFORMATION_SCHEMA view. This view includes disk usage by all MySQL tables in the disk usage totals.

  • 1 — Uses MySQL's INFORMATION_SCHEMA view.
  • 0 — Doesn't use MySQL's INFORMATION_SCHEMA view.
1
versionnumericThe system's Linux® Kernel version.A numeric value.3.4