Does Domino server support running PHP CGI programs?
Technote (FAQ)
Question
Can you run PHP CGI programs on a Lotus® Domino® server? What specifically is supported? You have reviewed the Domino Administrator Help but have additional questions.
Answer
A request to clarify information in the Domino Administrator Help has been submitted to Quality Engineering as SPR# AJAN6TDSWX. The Administration Help states that Domino supports PHP, when it it more accurate to state that Domino runs PHP; it is not supported.
With the proper configuration, Lotus Domino can run PHP CGI programs on a Domino server. CGI support is support for the CGI standard and not for any particular script interpreter. This CGI support includes script interpreters that require the name of the input file, such as PHP. All script interpreters should be placed outside Domino as a basic security precaution. The assistance provided by IBM Technical Support is limited to configuring the Domino server and the documents in the Domino Directory required to run the CGI program.
To configure Domino to run PHP, use the steps below. These steps assume the PHP script resides within the domino\data\HTML folder and that the PHP version is 5.0 or later. They differ from the steps in the Domino Administrator 7 Help because those steps run PHP as an in-line executable rather than a script interpreter. These updated directions allow PHP to reside in the HTML folder with html files, which is common in PHP environments.
Steps:
1. Install PHP per its instructions.
For example, on Microsoft Windows, you install PHP to a directory such as c:\php. Make sure the php.exe file can find its php.ini file, which will be installed in the default Windows directory (example c:\winnt). The php.ini file needs to be in the path (or in Windows system folder). It is very important that all paths are set up for PHP correctly. Refer to the PHP install instructions for more information.
On Linux, the location, if installed from source, would be /usr/local/bin/, You can use the command "which php" to locate your php file. If you enter "php -v" and do not see "CGI," then you must install php from source.
For use with Domino, the php.ini must include the line cgi.force_redirect = 0 as opposed to the common setup of ; cgi.force_redirect = 1. Without this change, you will see either a "Security Alert!" error page or "Error 500 Unable to process request, failed to transmit request data to script" or "CGI script failed to generate a response"
Domino needs full access to Read, List, and Execute in the folder for php.
2. Create or update the appropriate Domino documents to run PHP scripts.
a. If you are using Internet Sites, create a Web Site Rule from the Internet Site Document, with a rule type of Directory.
b. If you are not using Intenet Sites (disabled), create a URL Mapping/Redirection document with a type of "URL--> Directory."
3. For either document, enter the following settings:
Access: Execute
Incoming URL String: /*.php
Target Server Directory: the location of the PHP binary file
Windows: c:\php\php-cgi.exe/*.php (in PHP 5.0+)
or c:\php\php.exe/*.php (below PHP 5.0)
Linux: /usr/local/bin/php\*.php (change /usr/local/bin/php to the path listed from the linux command "which php")
4. With this Directory rule, the URL syntax for running a PHP script is as follows:
http:///
Where is the host name of the Web server and is the PHP script to be run. The default directory where the PHP will look for the script is defined by the DOCUMENT_ROOT CGI variable. By default, this is the /data/domino/html directory. PHP will look for the script relative to this directory.
For example, if the URL is the following
http://www.example.com/hello.php
Then, the script hello.php must be located in the /data/domino/html/hello.php directory. If the URL is http://www.example.com/foodir/hello.php, the script must be located in the /data/domino/html/foodir/hello.php.
Supporting Information:
The php.ini has many settings that affect the running of the PHP script handler; see the PHP documentation for more information. PHP: Hypertext Preprocessor is an HTML-embedded scripting language. Additional information is available at the following Web site:
http://www.php.net
Thank you this website
http://www-01.ibm.com/support/docview.wss?uid=swg21099845 |