BuycPanel Blog

BuycPanel Blog

Latest news and updates

A Brief Discussion on LiveAPI System

Posted by Allura on 22 10 2019.

Introduction
This system provides a specific place for applications within the cPanel interface, which is methodical in providing one’s code to connect domestically with the cPanel binary, cpsrvd. It allows one to make cPanel API 1, cPanel API 2, and UAPI function calls via the socket.Common components are administered by every LiveAPI to integrate with cPanel & WHM.When the places are used by the authenticated user, it helps him in executing the functions. Because of this, calls can fail if the authenticated user does not have adequate permissions.It is vital to notice that one cannot use the LiveAPI system to decide in approaching WHM API 0 or WHM API 1 functions.One can note that cPanel & WHM version 11.28 and earlier used this LivePHP system providing similar functionality, but it was specific to the PHP programming language.LiveAPI EnvironmentsThe LiveAPI PHP Class — It provides an environment for PHP applications.
The…

Introduction

This system provides a specific place for applications within the cPanel interface, which is methodical in providing one’s code to connect domestically with the cPanel binary, cpsrvd. It allows one to make cPanel API 1, cPanel API 2, and UAPI function calls via the socket.

Common components are administered by every LiveAPI to integrate with cPanel & WHM.

When the places are used by the authenticated user, it helps him in executing the functions. Because of this, calls can fail if the authenticated user does not have adequate permissions.

It is vital to notice that one cannot use the LiveAPI system to decide in approaching WHM API 0 or WHM API 1 functions.

One can note that cPanel & WHM version 11.28 and earlier used this LivePHP system providing similar functionality, but it was specific to the PHP programming language.

LiveAPI Environments

  • The LiveAPI PHP Class — It provides an environment for PHP applications.
  • The LiveAPI Perl Module — It arranges space for Perl applications.

The LiveAPI system additionally supports the subsequent languages whenever cPanel does not offer any categories for them:

  • Ruby
  • Python
  • Other languages, through custom CGI wrappers.

One will use CGI with the LiveAPI Perl module and for that, the user (root) should have their own CGI scripts, and the scripts must have 0755 file permissions.

Requirements

  • The code without failing should have the appropriate space and epitomize the respective class’s object.
  • File names must finish with the proper file extension:
    • PHP — .livephp or .live.php
    • Perl — .livepl or .live.pl
    • Ruby — .liverb or .live.rb
    • Python — .livepy or .live.py
    • CGI — .livecgi or .live.cgi
  • Files, or symlinks to the relevant files, shouls be there in the /usr/local/cpanel/base/frontend/theme/ directory, where theme stays as the cPanel theme (paper_lantern or another valid theme on the server).

We advocate the users to employ the Template Toolkit for Perl applications.

Conclusion

All information on the LiveAPI system is outlined in this article.