v1

latestOpenAPI 3.0.2cPanel License2026-08-06657427.1 MB
LangPHP
PHP Settings

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.

get/LangPHP/php_set_vhost_versions

Query parameters

versionstring required
Example:ea-php72

The PHP version of a virtual host.

vhoststring domain required

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.

Response

HTTP Request was successful.

apiversioninteger

The version of the API.

funcstring

The name of the method called.

modulestring

The name of the module called.

Example response

{
  "apiversion": 3,
  "func": "php_set_vhost_versions",
  "module": "LangPHP",
  "result": {
    "data": {
      "vhosts": [
        "example.com"
      ]
    },
    "status": 1
  }
}