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.
Usage
To use cPanel PHP, place a PHP script anywhere inside of the following directory:
- /usr/local/cpanel/base/frontend/
This directory corresponds to the following URL:
- http://www.example.com:2082/frontend/
Warning: Placing the script outside of this directory will cause the source code to be exposed.
cPanel tags are still available by using
<cpanel> and
<?cp> 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.
Important: cPanel PHP files should never use the short opening tag for PHP,
<?php should be used instead.
System Information
This system is provided by a custom PHP binary located in 1 of the following 2 directories:
- /usr/local/cpanel/3rdparty/bin/php
- /var/cpanel/3rdparty/bin/php
This PHP binary is
not customizable in any way, form, or fashion.
php.ini 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