Run php code in Paper lantern using .html.tt

tecwithquestion

Well-Known Member
Oct 20, 2014
65
2
58
cPanel Access Level
Root Administrator
Hello

I was using plugin which was working on x3 theme. That code written in .php

how can I use that code with .html.tt ? When I tried to create new file , my php code doesn't work
 

tecwithquestion

Well-Known Member
Oct 20, 2014
65
2
58
cPanel Access Level
Root Administrator
Hello

I already checked cpanel documentation couple of times but I an not able to run my php code in paper_latern.

Can you please tell me how can I get header and footer using .php file ?

If I use index.live.php file name, I am able to get header and footer but when I place my code in that file I get this error
Child failed to make LIVEAPI connection to cPanel.

Please help to get header footer and side bar using .php file.


Thanks
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,880
2,267
463

tecwithquestion

Well-Known Member
Oct 20, 2014
65
2
58
cPanel Access Level
Root Administrator
Hello

Thank you for the reply, but if I want to use below code, I must set file filename.live.php

<?php
include("/usr/local/cpanel/php/cpanel.php"); // Instantiate the CPANEL object.
$cpanel = new CPANEL(); // Connect to cPanel - only do this once.
print $cpanel->header( "Page Heading , app_key" ); // Add the header.
?>

Is that correct ?

Using this code, I am able to get header, but when I set my code in file, and run file , I get error
Child failed to make LIVEAPI connection to cPanel.

Can I get header and footer using only .php file ?
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,880
2,267
463
Hi,

I'm happy to see you solved the issue. Could you share the code change that you made?

Thanks!