PHP

From OCFwiki

Jump to: navigation, search

PHP is a popular programming language for creating dynamic web sites. The OCF currently supports the use of PHP 4 and PHP 5 on our web server through CGI scripts.

Contents

CGI

There are two ways to run PHP scripts as CGI scripts on the OCF web server:

  • You can treat them as regular CGI scripts, in which case the script name should end with .cgi and the path to the PHP interpreter should be specified at the top of the script.
  • If the file name has a .php extension, the script will be automatically parsed by the PHP interpreter.

PHP 5

By default, PHP scripts are interpreted using the PHP 4 interpreter. If you wish to use the PHP 5 interpreter, you may choose one of the following options:

  • Rename your PHP CGI scripts to end with a .php5 extension.
  • If you're treating your PHP scripts as regular CGI scripts, use /opt/ocf/bin/php5 as the path to the PHP interpreter.
  • Place an .htaccess file in the root of your PHP script directory (ex., in public_html) with the following contents:
    AddHandler cgiwrap-php5 .php

mod_php

For security reasons, the OCF does not support the execution of PHP scripts through mod_php.

See also

External links

Personal tools