Description

This function lists the system's PHP versions.

Examples 




https://hostname.example.com:2083/cpsess##########/execute/LangPHP/php_get_installed_versions



$cpanel = new CPANEL(); // Connect to cPanel - only do this once.
 
// List PHP versions installed on the system.
$php_get_installed_versions = $cpanel->uapi(
    'LangPHP', 'php_get_installed_versions'
   );



my $cpliveapi = Cpanel::LiveAPI->new(); # Connect to cPanel - only do this once.
 
# List PHP versions installed on the system.
my $php_get_installed_versions = $cpliveapi->uapi(
    'LangPHP', 'php_get_installed_versions',
  );



<!-- List PHP versions installed on the system. -->
[% execute( 'LangPHP', 'php_get_installed_versions' ) %]



uapi --user=username LangPHP php_get_installed_versions



{
   "messages":null,
   "errors":null,
   "status":1,
   "metadata":{
   },
   "data":{
      "versions":[
         "ea-php54",
         "ea-php55",
         "ea-php56"
      ]
   }
}



Parameters

This function does not accept parameters.

Returns

Return
Type
Description
Possible values
Example

versions

array

The available PHP versions.

In cPanel & WHM version 70 we updated this return to only show a virtual host's available PHP versions. In cPanel & WHM version 68 and earlier, this return displayed a virtual host's installed PHP versions.


ea-php56