Page tree
Skip to end of metadata
Go to start of metadata

 

Description

This function returns the PHP handlers on the system.

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. 
  • We introduced this functionality in cPanel & WHM version 11.52.0.8.

 Output (JSON)
{
   "data":{
      "version_handlers":[
         {
            "version":"ea-php55",
            "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-php55</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
  • Any installed PHP package.
ea-php55

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
  • Any installed PHP package.
ea-php55

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