Child pages
  • WHM API 1 Functions - php_get_handlers
Skip to end of metadata
Go to start of metadata

Description

This function returns the PHP handlers on the system.

Important:

In cPanel & WHM version 76 and later, when you disable the WebServer role, the system disables this function. For more information, read our How to Use Server Profiles documentation.

Examples


 JSON API
https://hostname.example.com:2087/cpsess##########/json-api/php_get_handlers?api.version=1&version=ea-php55
 XML API
https://hostname.example.com:2087/cpsess##########/xml-api/php_get_handlers?api.version=1&version=ea-php55
 Command Line
whmapi1 php_get_handlers version=ea-php55


Notes:

  • You must URI-encode values.
  • For more information and additional output options, read our Guide to WHM API 1 documentation or run the whmapi1 --help command.
  • If you run CloudLinux™, you must use the full path of the whmapi1 command:

    /usr/local/cpanel/bin/whmapi1

 Output (JSON)
{
   "data":{
      "version_handlers":[
         {
            "version":"ea-php70",
            "available_handlers":[
               "cgi",
               "none",
               "suphp"
            ],
            "current_handler":"suphp"
         }
      ]
   },
   "metadata":{
      "version":1,
      "reason":"OK",
      "result":"1",
      "command":"php_get_handlers"
   }
}
 Output (XML)
<result>
    <data>
        <version_handlers>
            <version>ea-php70</version>
            <available_handlers>cgi</available_handlers>
            <available_handlers>none</available_handlers>
            <available_handlers>suphp</available_handlers>
            <current_handler>suphp</current_handler>
        </version_handlers>
    </data>
    <metadata>
        <version>1</version>
        <reason>OK</reason>
        <result>1</result>
        <command>php_get_handlers</command>
    </metadata>
</result>


Note:

Use WHM's API Shell interface (WHM >> Home >> Development >> API Shell) to directly test WHM API calls.

Parameters

ParameterTypeDescriptionPossible valuesExample

version

stringAn installed PHP version.
  • ea-php54
  • ea-php55
  • ea-php56
  • ea-php70
  • ea-php71
  • ea-php72
  • Any custom PHP package name.
ea-php70

Returns

ReturnTypeDescriptionPossible valuesExample

version_handlers

array of hashesAn array of hashes of the available PHP handlers.

This array of hashes includes the version, current_handler, and available_handlers returns.

 

version

string

An installed PHP version.

The function returns this value in the version_handlers hash.

  • ea-php54
  • ea-php55
  • ea-php56
  • ea-php70
  • ea-php71
  • ea-php72
  • Any custom PHP package name.
ea-php70

current_handler

string

The PHP version's handler.

The function returns this value in the version_handlers hash.

  • suphp
  • cgi
  • dso
  • none
cgi

available_handlers

array

The installed PHP handlers.

The function returns this value in the version_handlers hash.

  • suphp
  • cgi
  • dso
  • none
cgi