Please whitelist cPanel in your adblocker so that you’re able to see our version release promotions, thanks!

The Community Forums

Interact with an entire community of cPanel & WHM users!

PHP Plugin not loading in header

Discussion in 'cPanel Developers' started by Mauritz, Jan 18, 2018.

  1. Mauritz

    Mauritz Well-Known Member

    Joined:
    Apr 29, 2015
    Messages:
    61
    Likes Received:
    0
    Trophy Points:
    6
    Location:
    Johannesburg
    cPanel Access Level:
    Root Administrator
    I created my first WHM plugin today (in PHP) which fundementally works perfectly, however, the plugin does not appear to load into the WHM wrapper. I have used the sample PHP code that is is supposed to load the header / footer but only the footer appears to work. There is simply no header included, only my HTML and then a couple of additional divs which I presume is related to the footer.

    What am I doing wrong? The require_once definately loads as the footer output is displayed, just not the header.

    <?php
    require_once('/usr/local/cpanel/php/WHM.php');
    WHM::header('My Plugin Header', 0, 0);
    ?>

    // MY HTML TEMPLATE DISPLAYS HERE

    <?php
    WHM::footer();
    ?>
     
  2. cPanelKenneth

    cPanelKenneth cPanel Development
    Staff Member

    Joined:
    Apr 7, 2006
    Messages:
    4,563
    Likes Received:
    43
    Trophy Points:
    308
    cPanel Access Level:
    Root Administrator
    Hello,

    Which version of cPanel & WHM are you testing on?
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  3. Mauritz

    Mauritz Well-Known Member

    Joined:
    Apr 29, 2015
    Messages:
    61
    Likes Received:
    0
    Trophy Points:
    6
    Location:
    Johannesburg
    cPanel Access Level:
    Root Administrator
    Hi Kenneth,

    v68.0.26

    Out of curiousity, can we get a development license? We're currently making changes to a live server which is less than ideal.
     
    #3 Mauritz, Jan 19, 2018
    Last edited by a moderator: Jan 19, 2018
  4. Infopro

    Infopro cPanel Sr. Product Evangelist
    Staff Member

    Joined:
    May 20, 2003
    Messages:
    16,478
    Likes Received:
    421
    Trophy Points:
    583
    Location:
    Pennsylvania
    cPanel Access Level:
    Root Administrator
    Twitter:
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  5. Mauritz

    Mauritz Well-Known Member

    Joined:
    Apr 29, 2015
    Messages:
    61
    Likes Received:
    0
    Trophy Points:
    6
    Location:
    Johannesburg
    cPanel Access Level:
    Root Administrator
    Thank you for the recommendation, we got a dev license :)

    Back to the actual issue, anyone able to give some guidance as to what I'm doing wrong?
     
  6. cPanelMichael

    cPanelMichael Technical Support Community Manager
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    44,803
    Likes Received:
    1,898
    Trophy Points:
    363
    cPanel Access Level:
    Root Administrator
    Twitter:
    Hello,

    This matches how the instructions we provide in our documentation. In addition to clearing your browser cache, try running the following command to see if it helps:

    Code:
    mv /var/cpanel/caches/_generated_command_files{,.backup}
    
    If not, feel free to open a support ticket so we can take a closer look.

    Thank you.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
Loading...

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice