Sign in

Run another PHP from Publii

  • This topic has 2 replies, 2 voices, and was last updated 1 month ago by .
Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
  • #10922
    Avatar photoHariko


    I want to call a counter.php which is in the same web directory.

    I have entered the following in the custom htlm header area <?php include ‘counter.php’; ?>

    but this does not work. How do I call the counter.php?


    Avatar photoprivii

    Normally PHP isn’t executed in .html files, which is what Publii generates. To make PHP run in .html files you can create a .htaccess file in the root directory and use AddHandler as described in this article for example. This isn’t a Publii specific issue.

    Avatar photoHariko

    Yes, this is how it works, but it took me a long time to find the right syntax for my provider If anyone is looking for this in the future.
    The support helped me further. The required string is:

    AddHandler php81-cgi .php .php5 .html .htm

Viewing 3 posts - 1 through 3 (of 3 total)
  • The topic ‘Run another PHP from Publii’ is closed to new replies.