php4 as CGI with aolserver3.1

From: Date: Thu, 01 Jan 1970 00:00:00 +0000
Subject: php4 as CGI with aolserver3.1
Groups: php.install 
Request: Send a blank email to php-install+get-314@lists.php.net to get a copy of this message
I've started the following topic on the aolserver bboard. Anyone on this list use aolserver with php? http://dev.aolserver.com/bboard/q-and-a-fetch-msg.tcl?msg_id=0000Jz&topic_id=15&topic=AOLserver%20Configuration Getting CGI to work. How? Your Workspace : Discussion Forums : AOLserver Configuration : One Thread I have installed PHP4 on our system as a cgi binary, but am having trouble getting aolserver 3.1 to run the scripts. When I load www.oursite.gt/script.php3 in a web browser, it just tries to download the file. Aolserver is not running the script. I can run the script from the shell as the aolserver user, and it runs correctly. What am I doing wrong? Here are some details from our nsd.tcl: # CGI interface -- nscgi, if you have legacy stuff. # ns_section "ns/server/${server}/module/nscgi" ns_param map "GET /*.php3" ns_param map "POST /*.php3" ns_param Interps CGIinterps ns_section "ns/interps/CGIinterps" ns_param .php3 "/usr/local/bin/php" # Modules to load # ns_section "ns/server/${server}/modules" ns_param nssock ${bindir}/nssock.so ns_param nslog ${bindir}/nslog.so ns_param nsperm ${bindir}/nsperm.so ns_param nscgi ${bindir}/nscgi.so -- Alan Pater, October 13, 2000 Answers (1) Is there some reason why you didn't install it as an AOLserver module? It's much faster that way. Add the following to your .tcl file after installing PHP4. ns_section "ns/server/$servername/modules" # php4 module ns_param php ${bindir}/libphp4.so # PHP4 # ns_section "ns/server/$servername/module/php" ns_param map *.php ns_param map *.php3 ns_param map *.php4 -- C. R. Oldham, October 13, 2000 Answers (2) >Is there some reason why you didn't install it as an AOLserver module? It's much faster that way. Because I read in php-4.0.3/sapi/aolserver/README: "NOTE: You should not use this module in production. PHP is not 100% stable yet in threaded mode. To increase reliability enable the Global Lock by removing #define NO_GLOBAL_LOCK in main/main.c. Also don't use php_value as it will lead to races in a sub-system (use an ini file instead)." Do you use php as an aolserver module? Is it stable enough for everyday use? We're installing the IMP webmail package, and it needs to be stable. If the aolserver module is robust enough, I'll do it that way. Otherwise, I've been reading more about php as a cgi binary, and may have found a reason for our problem. "Case 2: using --enable-force-cgi-redirect This compile-time option prevents anyone from calling PHP directly with a url like http://my.host/cgi-bin/php/secretdir/script.php3. Instead, PHP will only parse in this mode if it has gone through a web server redirect rule. Usually the redirection in the Apache configuration is done with the following directives: Action php3-script /cgi-bin/php AddHandler php3-script .php3 This option has only been tested with the Apache web server, and relies on Apache to set the non-standard CGI environment variable REDIRECT_STATUS on redirected requests. If your web server does not support any way of telling if the request is direct or redirected, you cannot use this option and you must use one of the other ways of running the CGI version documented here." I compiled PHP with this option. It sucks that php and it's documentation is so apache specific. So how do I do this setup with aolserver? What should I add to the nsd.tcl file? Something along the lines of? ns_param Environment CGIenvironment ns_section "ns/interps/CGIenvironment" ns_param REDIRECT_STATUS ????????? -- Alan Pater, October 13, 2000

« previous php.install (#314) next »