title: Calling Cpanel UAPI method
body: <p>i have the following simple script to list the ftp accounts
   but i am unable to get it to work as i have the following error as soon as it tries to call the constructor</p>
  
  <pre><code> include '/usr/local/cpanel/php/cpanel.php';
  $cpanel = new CPANEL(); // Connect to cPanel - only do this once.
  
  // List FTP account information.
  $list_ftp_accts = $cpanel-&gt;uapi('Ftp', 'list_ftp');
  echo "&lt;pre&gt;";
  print_r($list_ftp_accts);
  </code></pre>
  
  <blockquote>
    <p>Fatal error: Uncaught exception 'RuntimeException' with message 'There
    was a problem fetching the env variable containing the path to the
    socket' in /usr/local/cpanel/php/cpanel.php:146 Stack trace: #0
    /public_html/uapi.php(4): CPANEL->__construct() #1
    {main} thrown in /usr/local/cpanel/php/cpanel.php on line 146</p>
  </blockquote>
  
  <p>Line 146 in cpanel.php </p>
  
  <pre><code>$socketfile = getenv('CPANEL_PHPCONNECT_SOCKET');
  </code></pre>