Campsite 2.3 User Guide

Campsite 2.3 User Guide

Select your language:  
    Search:   
<7.2. PHPWrapper        8. APPENDIX I - ALPHABETIC LIST OF LANGUAGE STATEMENTS>

Print / Download:
Available languages: english Last update: 2005-09-02 12:21:08

7.2.1. Installing PHPWrapper

To install the PHPWrapper, you need to do the following. You will need root access to do much of this.

0. Download PHPWrapper and put it on your server.


1. Configure Apache

Make sure that rewrite-module will be loaded in the apache configuration file (usually httpd.conf):

LoadModule rewrite_module /apache_module_path/mod_rewrite.so

Make sure that following two directives are given for document-root:
<Directory [DOCUMENT_ROOT]>
Options FollowSymLinks
AllowOverride All
</Directory>

Example:
<Directory /var/www/html/>
Options FollowSymLinks
AllowOverride All
</Directory>
Add .wrap as PHP filetype:
AddType application/x-httpd-php .php .wrap

Once you've made the changes, restart apache or make it reload the config files  (e.g. "apache2ctl restart").

2. Files

Copy folder phpwrapper and .htaccess file into your Campsite document-root folder (for example, /var/www/html, or /usr/local/campsite/www/campware/html).  Make sure the files have the proper ownership (usually either "apache" or "www-data").

3. How it works

All requests to Campsite publication URLs except requests to administration interface will be redirected to the PHP script "simple_yahc.wrap". This script makes an internal HTTP request to get the parsed template from apache/Campsite parser. Then it executes the PHP code inside this and forwards the result to the browser.


4. Usage

All PHP code that comes from Campsite, either from static or dynamic content will be executed. You can use

<?php include ("scriptname"); ?>
or <!** include scriptname>. We suggest the first because if PHP didn't work (apache misconfiguration) this will hide the included PHP source. Make sure that PHP code is opened by
<?php and ended by ?>
(also <? if short_open_tag=on in php.ini).

Warning:
PHPWrapper also enables injection of code into content, so make sure that you can trust your editors. Be careful that no user-input is printed by Campsite (e.g. <!** print User ...>), or your visitors will be able to inject PHP code there.



Legal
PHPWrapper is distributed under the GNU GENERAL PUBLIC LICENSE


Author

PHPWrapper for Campsite was written originally written by Sebastian Göbel ([email protected]) using Yahc.class (see http://kimihia.org.nz/projects/yahc/). Subsequent revisions have been patched by Mugur Rus.


add a note add a note User Contributed Notes
7.2.1. Installing PHPWrapper
There are no user contributed notes for this page.

<7.2. PHPWrapper 8. APPENDIX I - ALPHABETIC LIST OF LANGUAGE STATEMENTS>

  Last update: 2005-09-02 12:21:08
Website powered by Docmint Last update: 2005-09-02 12:21:08
Total page time: 1.38826990128