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.

SecurityBasicAuth
Request
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
200

HTTP Request was successful.

Response Schema: application/json
object
object
get/php_get_vhosts_by_version
Request samples
whmapi1 --output=jsonpretty \
  php_get_vhosts_by_version \
  version='ea-php56'
Response samples
application/json
{
  • "data": {
    • "vhosts": [
      • "example.com"
      ]
    },
  • "metadata": {
    • "command": "php_get_vhosts_by_version",
    • "reason": "OK",
    • "result": 1,
    • "version": 1
    }
}