SOLVED problem fetching the env variable containing the path to the socket

Operating System & Version
CloudLinux 7.9
cPanel & WHM Version
11.92.0.11

manoaratefy

Well-Known Member
Nov 17, 2018
58
5
8
Madagascar
cPanel Access Level
Root Administrator
Twitter
Good morning,

I'm building a cPanel plugin. On my /usr/local/cpanel/base/frontend/paper_lantern/myplugin/index.php, I've put following code:

PHP:
<?php
ini_set('display_errors', 'on');
echo getenv('CPANEL_PHPCONNECT_SOCKET');
include("/usr/local/cpanel/php/cpanel.php");
$cpanel = new CPANEL();
print $cpanel->header("Mail Abuse");
?>

<?php
print $cpanel->footer();   
$cpanel->end();
?>
Now I'm facing a strange problem. When clicking on my plugin's icon on cPanel, this code show following error:
Code:
Fatal error: Uncaught RuntimeException: There was a problem fetching the env variablecontaining the path to the socket in /usr/local/cpanel/php/cpanel.php:146 Stack trace: #0 /home/account/.cpanel/.cpanel_phpengine.1614268526.137078w9d0V_qrbz(8): CPANEL->__construct() #1 {main} thrown in /usr/local/cpanel/php/cpanel.php on line 146
Does I did something wrong?

Note that on my another plugin, the same code works without any problem.
 
Last edited by a moderator: