BuycPanel Blog

Latest news and updates

An Introduction to the LiveAPI System

Posted by Allura on 23 08 2019.

Introduction

In the cPanel interface, the LiveAPI system offers an environment or a platform for applications. Each of these platforms or environments makes way for your code to communicate locally with the cPanel binary system, cpsrvd. This function allows users to develop cPanel API1, cPanel API 2, and UAPI function calls through the socket.

Each LiveAPI class provides elements which integrate with cPanel and WHM.

The user authenticated to work on this platform is responsible for the execution of functions when you use these environments. In case, the authenticated user fails to own necessary permissions; the calls may fail.

However, the LiveAPI system cannot be used to call WHM API 0 or WHM API 1 functions.

Note:

cPanel, WHM version 11.28, and all the previous versions incorporated LivePHP system which came with a functionality that is comparable but particular to the PHP programming language.

LiveAPI Environments

CPanel and WHM provide classes for the LiveAPI system. These are:

The LiveAPI PHP Class – An environment for PHP based applications are offered by the LiveAPI PHP Class.

The LiveAPI Perl Module – An environment for Perl applications is provided by The LiveAPI Perl Module.

Currently, cPanel does not provide classes for specific languages, but the LiveAPI system makes sure to support them. These languages have been stated below:

Python

Ruby

Other languages which are through custom CGI wrappers.

Note:

The LiveAPI Perl unit lets you use CGI with it. The root user is advised and required to own CGI scripts. However, the CGI scripts should have permissions for the 0755 file.

Requirements for a LiveAPI system

Every application that uses a LiveAPI environment comes with certain conditions, and these requirements must be met. These are enlisted below.

A code must have a few mandatory components for it be valid. It must have embedded the right environment and represent the corresponding class’s object in it.

All file names are required to end with the applicable file extension.

PHP — .livephpor .live.php

Ruby — .liverbor .live.rb

Perl — .liveplor .live.pl

CGI — .livecgior .live.cgi

Python — .livepyor .live.py

Either files or symlinks to the appropriate files must be in place and in correct format in the /usr/local/cpanel/base/frontend/theme/ The prevailing theme is the cPanel theme of a paper_lantern or any other valid theme present on the server.

Note:

It is advised that the Template Toolkit is used for Perl applications.

Conclusion:

The guidelines to the LiveAPI system has been mentioned elaborately in this document. Find requirements and all the necessary information to make sure your desktop is equipped to host the LiveAPI system and for you to work on it skillfully.