latestOpenAPI 3.0.2cPanel License2026-08-106251554.3 MB

3da41671c02c

PHP

Return virtual hosts per PHP version

This function lists the virtual hosts that use a specified version of PHP.

Note:

This document only applies to systems that run EasyApache 4.

Important:

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

get/php_get_vhosts_by_version

Query parameters

versionstring required
Example:ea-php56

The name of an installed PHP package.

  • ea-php##, where ## represents the major and minor versions of PHP (for example, ea-php72 represents PHP 7.2).
  • inherit
  • Any custom PHP package name.

Response

HTTP Request was successful.

Example response

{
  "data": {
    "vhosts": [
      "example.com"
    ]
  },
  "metadata": {
    "command": "php_get_vhosts_by_version",
    "reason": "OK",
    "result": 1,
    "version": 1
  }
}