Guide to the LiveAPI System

Introduction

The LiveAPI System provides environments for applications in cPanel's x3 theme. Each environment provides a way for your code to interact locally with the cPanel binary, cpsrvd . This allows you to make cPanel API 1, cPanel API 2, and UAPI function calls via the socket.

  • Each LiveAPI class provides common elements to integrate with cPanel & WHM. 
  • When you use these environments, the authenticated user executes the functions. Because of this, calls may fail if the authenticated user does not have adequate permissions.

Important:

For applications built in the Perl programming language, we recommend that you use Template Toolkit.  

Note:

cPanel & WHM version 11.28 and earlier used the LivePHP system, which provided similar functionality, but was specific to the PHP programming language.

LiveAPI environments

cPanel & WHM provides the following classes for the LiveAPI system:

While cPanel does not currently provide classes for them, the LiveAPI system also supports the following languages:

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

Note:

You can use CGI with the LiveAPI Perl module.

  • An example script for this method ships with cPanel & WHM in the/usr/local/cpanel/base/frontend/x3/test.live.cgi file.
  • The root user must own CGI scripts, and the scripts must have 0755 file permissions.

Requirements

Applications that use a LiveAPI environment must meet the following requirements:

  • The code must include the appropriate environment and instantiate the respective class's object.
  • File names must end with the appropriate 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, must exist in the /usr/local/cpanel/base/frontend/theme/ directory, where theme is the cPanel theme (x3 or paper_lantern).
  • 0 Users Found This Useful
Was this answer helpful?

Related Articles

The cPanel Interface

For  cPanel  &  WHM  version  58 Overview The cPanel interface is...

User Preferences

For cPanel & WHM version 58 Overview This document outlines how to access your cPanel...

Manage External Authentications

For cPanel & WHM version 58 Overview Manage credentials Additional documentation...

What is cPanelID?

In This Article:  Overview ServicesHow to get a cPanelID cPanelID External...

Guide to cPanel Interface Customization - cPanel Style Development

Introduction You can develop custom styles that modify the appearance of the cPanel interface....