---
title: "Return PHP version of all virtual hosts"
method: GET
path: "/php_get_vhost_versions"
tags: ["PHP"]
---

# Return PHP version of all virtual hosts

`GET /php_get_vhost_versions`

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

**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.

## Response `200`

HTTP Request was successful.

- object
  - `data` object
    - `versions` object[] — An array of objects containing the virtual host's suspendend status, versions, virtual hosts, and accounts.
      - `account` string, username — The account's name.
      - `account_owner` string, username — The account owner's name.
      - `documentroot` string — The virtual host's document root.
      - `homedir` string — The virtual host's home directory.
      - `is_suspended` 1 | 0 — The virtual host's suspension status. **Note:** * `1` - Suspended * `0` - **Not** suspended.
      - `main_domain` 1 | 0 — Whether the virtual host is the primary domain. **Note:** * `1` - The primary domain * `0` - **Not** the primary domain
      - `php_fpm` 1 | 0 — Whether PHP-FPM is enabled. * `1` - PHP-FPM enabled. * `0` - PHP-FPM **not** enabled.
      - `php_fpm_pool_parms` object — 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 number of possible requests the system allows.
        - `pm_process_idle_timeout` integer — How long the system remains idle before it kills the 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` * `inherit` * Any custom PHP package name.
      - `vhost` string — The virtual host's name.
  - `metadata` object
    - `command` string — The method name called.
    - `reason` string — The reason the API function failed when the `metadata.result` field is 0. This field may display a success message when a function succeeds.
    - `result` 1 | 0 — * `1` - Success * `0` - Failed: Check the reason field for more details.
    - `version` integer — The version of the API function.

---

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