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

 

Description

This function allows for WHM's MultiPHP Manager interface (Home >> Software >> MultiPHP Manager) to change the the values of a domain.

Examples


 JSON API
https://hostname.example.com:2087/cpsess##########/json-api/php_set_vhost_versions?api.version=1&version=ea-php55&vhost-0=rm5.tld
 XML API
https://hostname.example.com:2087/cpsess##########/xml-api/php_set_vhost_versions?api.version=1&version=ea-php55&vhost-0=rm5.tld
 Command Line
Set a version for a vhost
whmapi1 php_set_vhost_versions version=ea-php55 vhost-0=rm5.tld
Set the PHP-FPM parameters
whmapi1 php_set_vhost_versions vhost-0=rm5.tld php_fpm_pool_parms='{"pm_max_children":15,"pm_process_idle_timeout":100,"pm_max_requests":200}' php_fpm=1 version=ea-php56

 

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)
{  
   "metadata":{  
      "reason":"OK",
      "result":1,
      "command":"php_set_vhost_versions",
      "version":1
   },
   "data":{  

   }
}
 Output (XML)
<result>
    <metadata>
        <reason>OK</reason>
        <result>1</result>
        <command>php_set_vhost_versions</command>
        <version>1</version>
    </metadata>
    <data/>
</result>


Note:

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

   

Parameters

ParameterTypeDescriptionPossible valuesExample
php_fpm_pool_parmsJSON

A JSON string that encodes a hash of values.

Note:

$body

A valid JSON string that contains the pm_max_children, pm_process_idle_timeout, and pm_max_requests parameters.

 

pm_max_children

integer

The maximum number of child pages per pool.

You must supply this value in the php_fpm_pool_parms hash.

This parameter defaults to 5.

A valid child value.5

pm_process_idle_timeout

integer

A specified time of idleness before the system kills an FPM child.

You must supply this value in the php_fpm_pool_parms hash.

This parameter defaults to 10.

A valid timeout value.

 

10

pm_max_requests

integer

The maximum number of requests per pool.

You must supply this value in the php_fpm_pool_parms hash.

This parameter defaults to 20.

A valid request value.20
php_fpmBooleanWhether PHP-FPM is enabled.
  • 1 — PHP-FPM enabled.
  • 0 — PHP-FPM not enabled.
1

version

string

The virtual host's PHP version.

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

vhost-0

string

The virtual host's name.

A valid hostname.otherchars.rm3.tld

Returns

This function only returns metadata.