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.

Authorizations:
query Parameters
version
required
string

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.
Example: version=ea-php56

Responses

Response Schema: application/json
object
object

Request samples

whmapi1 php_get_vhosts_by_version version='ea-php56'

Response samples

Content type
application/json
{
  • "data": {
    • "vhosts": [
      • "example.com"
      ]
    },
  • "metadata": {
    • "command": "php_get_vhosts_by_version",
    • "reason": "OK",
    • "result": 1,
    • "version": 1
    }
}