How to use PHP inside Confluence pages

お困りですか?

アトラシアン コミュニティをご利用ください。

コミュニティに質問

目的

For security reasons, Confluence does not allow PHP code inside pages. However, it's possible to install an Apache and PHP module on the same server, and include the PHP file so that the output can be shown inside Confluence.

ソリューション

  1. Install Apache + PHP in a server (it can be the same server used for Confluence).
  2. In Confluence navigate to Confluence Admin > Manage Add-ons and enable the html and html-include macros.
  3. Create a PHP file for test purposes on your Apache. Make sure that it's working locally.
  4. Copy the URL from the PHP file and paste it in Confluence Admin > Whitelist so that Confluence will trust it.
  5. Create a page on Confluence and use the html-include macro with the URL from Step 4.
  6. This will allow the PHP file to be interpreted by Apache, and the result will be shown in Confluence.
最終更新日: 2016 年 2 月 26 日

この内容はお役に立ちましたか?

はい
いいえ
この記事についてのフィードバックを送信する
Powered by Confluence and Scroll Viewport.