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!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

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:
    60
    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,553
    Likes Received:
    40
    Trophy Points:
    308
    cPanel Access Level:
    Root Administrator
    Hello,

    Which version of cPanel & WHM are you testing on?
     
  3. Mauritz

    Mauritz Well-Known Member

    Joined:
    Apr 29, 2015
    Messages:
    60
    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,067
    Likes Received:
    348
    Trophy Points:
    433
    Location:
    Pennsylvania
    cPanel Access Level:
    Root Administrator
    Twitter:
  5. Mauritz

    Mauritz Well-Known Member

    Joined:
    Apr 29, 2015
    Messages:
    60
    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 Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    42,734
    Likes Received:
    1,706
    Trophy Points:
    363
    cPanel Access Level:
    Root Administrator
    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.
     
Loading...

Share This Page