Using PHP in the cPanel Interface
cPanel allows for additional pages to be written in PHP rather than straight HTML. This provides full access to our APIs via our API tags
To use cPanel PHP, place a PHP script anywhere inside of the following directory:
This directory corresponds to the following URL:
Placing the script outside of this directory will cause the source code to be exposed.
cPanel tags are still available by using <cpanel>
tags. These tags can be executed before or after the PHP script. The order of execution is determined by the file extension used:
- .php — Executes cPanel tags before the PHP code
- .cpphp — Executes cPanel tags before the PHP code
- .phpcp — Executes the PHP code followed by the cPanel tags.
cPanel PHP files should never use the short opening tag for PHP, <?php
should be used instead.
This system is provided by a custom PHP binary located in 1 of the following 2 directories:
This PHP binary is not customizable
in any way, form, or fashion.
for cPanel PHP is available at:
- /usr/local/cpanel/3rdparty/etc or /var/cpanel/3rdparty/etc
Topic revision: r5 - 10 Aug 2010 - 18:07:54 - AyeMaung
AllDocumentation/AutomationIntegration.CpanelPhp moved from Sandbox.UsingPHPInterface on 30 Sep 2009 - 19:36 by Main.JustinSchaefer