# Return PHP compatibility

This function reports whether the PHP version a WordPress installation
would run under meets the minimum that WordPress requires.

  Note:

  * Two PHP versions must pass: the server's system default PHP, which
    WordPress Toolkit uses while it stages the installation outside the
    document root, and the domain's own PHP, which serves the site
    afterwards.
  * A cPanel user can change a domain's PHP version in MultiPHP Manager,
    but only the hosting provider can change the system default.
  * The create_website, create_nova_for_wordpress_website, and
    import_website functions run the same check. When it fails, they
    return the status field set to unsupported_php with this
    function's data.

Endpoint: GET /WPX/get_php_compatibility
Version: 11.138.0.19
Security: BasicAuth

## Query parameters:

  - `domain` (string)
    The domain to evaluate. The system normalizes the value to lowercase.

* When present, the system checks the domain's own PHP version in
  addition to the system default. The domain must belong to the
  account, or the function returns an error.
* When absent or empty, or when the account has no virtual host for
  the domain yet, the system only evaluates the system default.
    Example: "example.com"

## Response 200 fields (application/json):

  - `apiversion` (integer)
    The version of the API.
    Example: 3

  - `func` (string)
    The name of the method called.
    Example: "get_php_compatibility"

  - `module` (string)
    The name of the module called.
    Example: "WPX"

  - `result` (object)

  - `result.data` (object)
    The PHP compatibility verdict.

  - `result.data.blocked_by` (array)
    Which PHP versions fall below the minimum. Empty when
compatible is 1.
- system_default - The server default PHP is too old.
  Only the hosting provider can change it.
- domain - The domain's PHP is too old. Change it in
  MultiPHP Manager, on the row that the
  domain_version_vhost return field names.
    Enum: "system_default", "domain"

  - `result.data.compatible` (integer)
    Whether WordPress can install.
- 1 - Every known PHP version meets the minimum.
- 0 - At least one version in blocked_by is too old.
    Enum: 1, 0

  - `result.data.domain` (string,null)
    The evaluated domain, normalized to lowercase. null when no domain was given.
    Example: "example.com"

  - `result.data.domain_package` (string,null)
    The PHP package the domain runs. null when no domain was given or the account has no virtual host for it.
    Example: "ea-php73"

  - `result.data.domain_version` (string,null)
    The domain's PHP version as major.minor. null when unknown.
    Example: "7.3"

  - `result.data.domain_version_source` (string,null)
    Where the domain's version comes from.
- domain - Set on the domain or an ancestor document root.
- system_default - Inherited from the server default.
    Enum: "domain", "system_default"

  - `result.data.domain_version_vhost` (string,null)
    The virtual host whose PHP setting domain_version
comes from. This is the row to change in MultiPHP
Manager. For a parked (alias) domain, the subdomain
behind an addon domain, or a domain that inherits an
ancestor document root's setting, this differs from
domain. null when the version is inherited from
the system default or is unknown.
    Example: "example.com"

  - `result.data.effective_version` (string,null)
    The lowest known version of the two, which is the version that decides the verdict. null when neither is known.
    Example: "7.3"

  - `result.data.is_fallback` (integer)
    - 1 - A version lookup failed. The unknown version did
  not block, so the verdict may be optimistic. The
  installation itself reports any problem.
- 0 - Every lookup succeeded.
    Enum: 1, 0

  - `result.data.required_version` (string)
    The minimum PHP version WordPress requires, as major.minor.
    Example: "7.4"

  - `result.data.system_default_package` (string,null)
    The server's default PHP package. null when unknown.
    Example: "ea-php73"

  - `result.data.system_default_version` (string,null)
    The server's default PHP version as major.minor. null when unknown.
    Example: "7.3"

  - `result.errors` (array,null)
    List of errors if the API failed.

  - `result.messages` (array,null)
    List of messages generated by the API.

  - `result.metadata` (object)

  - `result.metadata.transformed` (integer)
    Post-processing may have transformed the data.
    Enum: 1

  - `result.status` (integer)
    - 1 - Success.
- 0 - Failed: Check the errors field for more details.
    Enum: 1, 0

  - `result.warnings` (array,null)
    List of warnings generated by the API. Warnings describe non-critical failures or other problematic conditions noted while running an API.


