Das Notes Forum

Domino 9 und frühere Versionen => ND7: Administration & Userprobleme => Thema gestartet von: blizzard am 10.07.08 - 09:54:45

Titel: php + domino
Beitrag von: blizzard am 10.07.08 - 09:54:45
Hallo,

irgendwie Mühe ich mich gerade ab hierzu irgendwie etwas brauchbares im Web zu finden.

Folgende Thematik:
ich möchte php seiten auf einem domino http task zum laufen zu bekommen. PHP ist installiert, cgi.force_redirect auf 0 gestellt in der php.ini und eine URL Mapping/Redirection ist angelegt.
Allerdings mag mein php script nicht laufen und Internal Server Error 500 Reason: Bad script request -- no variation is executable erscheint im Browser.

Die Requirements sind mir auch nicht ganz klar um das ganze am laufen zu halten. Brauche ich neben der php installation und dem domino server mit http task noch etwas anderes? Einige Seiten sprechen hier von einem zusätzlichen Webserver andere wiederum nicht. Hat jemand hier passendes Material bzw. eine Technote, Redbook oder was auch immer zur Installation?

Danke
Titel: Re: php + domino
Beitrag von: m3 am 10.07.08 - 09:58:36
"lotus domino php cgi" auf google.com eingeben, "I feel Lucky" drücken:

Does Domino server support running PHP CGI programs? (http://www.ibm.com/support/docview.wss?uid=swg21099845)

Zitat
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://<server>/<php-script>
            Where <server> is the host name of the Web server and <php-script> 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.
Titel: Re: php + domino
Beitrag von: blizzard am 10.07.08 - 10:16:49
danke Martin.
das ist auch das einzigste was ich von ibm zu dem thema richtig gefunden habe.
Wie schon beschrieben habe ich alles so eingerichet wie hier beschrieben wird, allerdings bekomme ich trotzdem den internal error. php selbst scheint zu funktionieren, jedenfalls für er das script aus wenn ich es per cmd aufrufe.

Ich werde mal weiter testen
Titel: Re: php + domino
Beitrag von: jBubbleBoy am 10.07.08 - 10:57:50
Hallo,
bei jnotes gibt es dazu einen Beitrag:
http://www.jnotes.de/JNotes/jnotes_webware.nsf/0/DC917B0B4E786832C1256E15004A0327?openDocument
Wenn man im Kontaktformular eine freundliche Anfrage stellt bekommt man auch das Servlet zugesendet.

bubble
Titel: Re: php + domino
Beitrag von: blizzard am 10.07.08 - 11:28:19
ja danke bubble, allerdings sollte laut der Beschreibung von ibm wie Martin sie gepostet hat, das ganze auch funktionieren ohne dieses Servlet - also direkt.

Hat denn jemand php mit domino in dieser Konstellation am laufen?
Titel: Re: php + domino
Beitrag von: blizzard am 11.07.08 - 09:51:16
kurze info.
PHP und Domino funktionieren nun. Es ist nicht nötig einen Apachen oder sonst etwas dazu zuinstallieren.
Titel: Re: php + domino
Beitrag von: m3 am 11.07.08 - 09:57:25
Und woran scheiterte/lag es?
Titel: Re: php + domino
Beitrag von: blizzard am 14.07.08 - 11:07:56
also es müssen die richtigen internet sites bzw web configs gebaut werden, wie in dem artikel von dir gepostet.
wichtig is auch dass man bei der php installation die cgi sachen mitinstalliert und es auf keinen fall nach \program files\ installiert. Hat wohl scheinbar nen problem mit dem whitespace. Auch mit DOS Schreibweise wollte er das nicht akzeptieren.
und natürlich in der php.ini den redirect auf 0 setzt. Ansonsten braucht man weder apache noch servlets noch sonst was.