PHParser 1.1.5 Installation Instructions
- PHP 4.0 and up compiled as CGI. Neither Apache module nor the CLI version coming with PHP 4.3.0 will work. You probably will compile PHP from the source on Unix platforms. Older RedHat PHP RPM packages don't contain PHP CGI. But RHEL 4 and Linux distributions based on RHEL4, such as WhiteBox and CentOS, do contain PHP CGI in the RPM. For Windows, you can download and use any of the Windows Binaries.
- Your PHP CGI must be compiled with
- In your PHP configuration file that affect PHP CGI (php-cgi.ini or php.cgi if the former doesn't exist), the
doc_rootdirective MUST be empty.
- You might need to modify the PHPath line in PHParser.py to specify the full path of the PHP CGI executable. For example, the default value for Unix
/usr/bin/phpis the location of the PHP CGI installed by RedHat RPM.
- Alternatively, you can create a symbol link
/usr/bin/phppointing to where your PHP CGI's really located to avoid modifying the product source. Thanks to Michael W. Dietrich, who discovered this.
- If you want to turn HTTP authentication support on, you need to modify PHParser.py to set
EXPOSE_HTTP_AHTHORIZATION=1. But doing this may tell the PHP script your ZMI username and password. Don't do it if you don't trust the script to be parsed or gatewayed.
- PHParser and PHPGateway have always been compatible with
Virtual Host Monsterproduct on a standalone Zope server. Now, with the help of Maric Michaud, Zope server behind Apache rewrite rules are also supported!
cd ZOPE_HOME/lib/python/Products tar -zxvf /path/to/downloaded/PHParser-x.y.z.tar.gz (Optinoal modification to the source files) Restart Zope
unzip PHParser-x.y.z.tar.gz to ZOPE_HOME\lib\python\Products (Optinoal modification to the source files) Restart Zope
User Modifitable Options:
* PHPath Where your PHP CGI program is located. Default is "c:\\php\\php.exe" for Win32 and "/usr/bin/php" for Unix. * ENVPath Where your 'env' program is located. Default is 'env'. (Unix only) * EXPOSE_HTTP_AUTHORIZATION If the PHP script to be parsed depends on HTTP authentication information, you need to change it to '1'. Default is '0'.
* DEFAULTPAGES A list of default pages to search if the request truns out to be a directory. Default is ['index.html', 'index.htm', 'default.htm', 'index.php', 'index.php3'] * PHPEXT A list of file extensions that are to be parsed as PHP. Other files are served as static contents. Defalult is ['.php', '.php3']