---
title: "Return virtual host's PHP version"
method: GET
path: "/LangPHP/php_get_vhost_versions"
tags: ["LangPHP", "PHP Settings"]
---

# Return virtual host's PHP version

`GET /LangPHP/php_get_vhost_versions`

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](https://go.cpanel.net/howtouseserverprofiles#roles), the system **disables** this function.

## Query parameters

- `vhost` string

## Response `200`

HTTP Request was successful.

- object
  - `apiversion` integer — The version of the API.
  - `func` string — The name of the method called.
  - `module` string — The name of the module called.
  - `result` object
    - `data` object[] — 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.
      - `account` string, username — The account's name.
      - `account_owner` string, username — The account's owner.
      - `documentroot` string, path — The virtual host's document root.
      - `homedir` string, path — The virtual host's home directory.
      - `main_domain` 1 | 0 — Whether the virtual host is the primary domain. **Note:** * `1` - The primary domain * `0` - **Not** the primary domain
      - `php_fpm` 0 | 1 — Whether FPM is enabled on the virtual host. * `1` - PHP-FPM enabled. * `0` - PHP-FPM **not** enabled.
      - `php_fpm_pool_parms` object — An object containing the domain's PHP-FPM parameters.
        - `pm_max_children` integer — The maximum number of child pages per pool.
        - `pm_max_requests` integer — The maximum number of requests per pool.
        - `pm_process_idle_timeout` integer — A specified time of idleness before the system kills an FPM child process.
      - `phpversion_source` object[] — How the virtual host determines its PHP version.
        - `domain` string, domain — The domain the virtual host inherits its PHP version from.
        - `system_default` 1 — 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.
      - `version` string — The virtual host's PHP version. * `ea-php72` * `ea-php73` * `ea-php74` * Any custom PHP package name.
      - `vhost` string, domain — The virtual host's name.
    - `errors` string[], nullable — List of errors if the API failed.
    - `messages` string[], nullable — List of messages generated by the API.
    - `metadata` object
      - `transformed` 1 — Post-processing may have transformed the data.
    - `status` 0 | 1 — - 1 - Success - 0 - Failed: Check the errors field for more details.
    - `warnings` string[], nullable — List of warnings generated by the API. Warnings describe non-critical failures or other problematic conditions noted while running a API.

---

[API](https://skmtc.net/cpanel/apis/cpanel-uapi.md) · [All operations](https://skmtc.net/cpanel/apis/cpanel-uapi/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/cpanel/cpanel-uapi/revisions/632e2f8e6d04/schema)
