plesk/api-php-lib

Class "pm_ApiRpc" not found

liam-gen opened this issue · 1 comments

Hey,

I have this error :/
Fatal error: Uncaught Error: Class "pm_ApiRpc" not found in /var/www/vhosts/yrup.tk/httpdocs/plesk-api/src/Api/Client.php:172 Stack trace: #0 /var/www/vhosts/yrup.tk/httpdocs/plesk-api/src/Api/Operator/Server.php(15): PleskX\Api\Client->request() #1 /var/www/vhosts/yrup.tk/httpdocs/index.php(6): PleskX\Api\Operator\Server->getProtos() #2 {main} thrown in /var/www/vhosts/yrup.tk/httpdocs/plesk-api/src/Api/Client.php on line 172

This is my code :

<?php
ini_set("display_errors", 1);
require_once("plesk-api/vendor/autoload.php");

$client = new \PleskX\Api\InternalClient();
$protocols = $client->server()->getProtos();

print_r($protocols);

Where is the problem ?

InternalClient is usable only in the scope of Plesk extensions.
Use \PleskX\Api\Client() instead.