# Return virtual host's PHP version

This function returns the PHP version of every virtual host that a reseller controls.

You can get the version of a single virtual host by providing an optional vhost name.

Note:

  This document only applies to systems that run EasyApache 4.

Important:

  When you disable the Web Server role, the system disables this function.

Endpoint: GET /LangPHP/php_get_vhost_versions
Version: 11.136.0.4
Security: BasicAuth

## Query parameters:

  - `vhost` (string)
    The PHP Virtual Hostname.
    Example: "your-domain.test"

## Response 200 fields (application/json):

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

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

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

  - `result` (object)

  - `result.data` (array)
    An array of objects of the virtual host's suspended
status, versions, virtual hosts, and accounts.
Note: Returns a single object when using the vhost parameter.

  - `result.data.account` (string)
    The account's name.
    Example: "blee"

  - `result.data.account_owner` (string)
    The account's owner.
    Example: "blee"

  - `result.data.documentroot` (string)
    The virtual host's document root.
    Example: "/home/blee/public_html"

  - `result.data.homedir` (string)
    The virtual host's home directory.
    Example: "/home/blee"

  - `result.data.main_domain` (integer)
    Whether the virtual host is the primary domain.

Note:

* 1 - The primary domain
* 0 - Not the primary domain
    Enum: 1, 0

  - `result.data.php_fpm` (integer)
    Whether FPM is enabled on the virtual host.

* 1 - PHP-FPM enabled.
* 0 - PHP-FPM not enabled.
    Enum: 0, 1

  - `result.data.php_fpm_pool_parms` (object)
    An object containing the domain's PHP-FPM parameters.

  - `result.data.php_fpm_pool_parms.pm_max_children` (integer)
    The maximum number of child pages per pool.
    Example: 5

  - `result.data.php_fpm_pool_parms.pm_max_requests` (integer)
    The maximum number of requests per pool.
    Example: 20

  - `result.data.php_fpm_pool_parms.pm_process_idle_timeout` (integer)
    A specified time of idleness before the system kills an FPM child process.
    Example: 10

  - `result.data.phpversion_source` (array)
    How the virtual host determines its PHP version.

  - `result.data.phpversion_source.domain` (string)
    The domain the virtual host inherits its PHP version from.
    Example: "blee.com"

  - `result.data.phpversion_source.system_default` (integer)
    Whether the virtual host uses the system's default PHP version.
* 1 - Uses the system default PHP version.

Note:

  The function only returns this value if true.
    Enum: 1

  - `result.data.version` (string)
    The virtual host's PHP version.
* ea-php72
* ea-php73
* ea-php74
* Any custom PHP package name.
    Example: "ea-php72"

  - `result.data.vhost` (string)
    The virtual host's name.
    Example: "blee.com"

  - `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: 0, 1

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


