The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Enable PHP in cPanel Themes

Discussion in 'General Discussion' started by sirbrent, Jan 31, 2009.

  1. sirbrent

    sirbrent Well-Known Member

    Joined:
    Sep 30, 2008
    Messages:
    98
    Likes Received:
    1
    Trophy Points:
    8
    Hello,

    I was wondering how I can enable the use of PHP in my customized cPanel themes.
     
  2. cPanelDavidG

    cPanelDavidG Technical Product Specialist

    Joined:
    Nov 29, 2006
    Messages:
    11,279
    Likes Received:
    8
    Trophy Points:
    38
    Location:
    Houston, TX
    cPanel Access Level:
    Root Administrator
    Simply have your PHP files end in .php to allow for the execution of only PHP.

    If you with to also use cPanel's APIs (common for themes), you can use .phpcp or .cpphp

    .phpcp means to execute PHP code first, then execute the cPanel API code. This is useful if you wish to pass parameters from PHP to the API code.

    .cpphp means execute the API code first then execute the PHP code. This is useful if you wish to send data from the APIs to your PHP script.

    There are additional alternatives such as LivePHP, but that's only if you wish to call our APIs directly from PHP rather than using .cpphp or .phpcp.
     
Loading...

Share This Page