Update virtual host's PHP version

This function sets a virtual host's PHP version.

Note:

This document only applies to systems that run EasyApache 4.

Important:

When you disable the WebServer role, the system disables this function.

SecurityBasicAuth
Request
query Parameters
version
required
string

The PHP version of a virtual host.

Example: version=ea-php72
vhost
required
string <domain>

The virtual host's name.

Note:

To change the PHP version of multiple virtual hosts, duplicate or increment the parameter name. For example, vhost-1, vhost-2, and vhost-3.

Examples:
vhost=vhost-1=example.com&vhost-2=example2.com&vhost-3=example3.com
vhost=example.com
Responses
200

HTTP Request was successful.

Response Schema: application/json
apiversion
integer

The version of the API.

func
string

The name of the method called.

module
string

The name of the module called.

object
get/LangPHP/php_set_vhost_versions
Request samples
uapi --output=jsonpretty \
  --user=username \
  LangPHP \
  php_set_vhost_versions \
  version='ea-php72' \
  vhost='example.com'
Response samples
application/json
{
  • "apiversion": 3,
  • "func": "php_set_vhost_versions",
  • "module": "LangPHP",
  • "result": {
    • "data": {
      • "vhosts": [
        • "example.com"
        ]
      },
    • "errors": null,
    • "messages": null,
    • "metadata": { },
    • "status": 1,
    • "warnings": null
    }
}