RE: [PHP] What's more common: CGI or module installation?

From: Date: Tue, 01 Aug 2000 03:45:57 +0000
Subject: RE: [PHP] What's more common: CGI or module installation?
Groups: php.general 
Request: Send a blank email to php-general+get-9349@lists.php.net to get a copy of this message
You could use SSI. If it's enabled, rename the file to test.shtml, and do this: <!--#exec cgi="/path/to/your/php/script.php" --> Make sure that your script.php is executable (chmod +x script.php) and includes this as its first line: #!/usr/local/bin/php (substituting the path to the PHP CGI binary, of course) HOWEVER, even if PHP is installed as a CGI, you can STILL have Apache automatically parse *.php (or whatever) files. Put the following commands in a file called .htaccess in the folder in which you want to enable PHP: Options +ExecCGI Action application/x-httpd-php "/usr/local/bin/php" (or whatever PHP's location in) AddType application/x-httpd-php .php AddType application/x-httpd-php .html That will enabled any files that end in .html or .php to be preprocessed by PHP before they're outputted. --Bruce Bruce Christensen Intel Corporation brucex.r.christensen@intel.com -----Original Message----- From: Murph [mailto:murph@murphatnight.com] Sent: Monday, July 31, 2000 8:31 PM To: Christensen, BruceX R; PHP mailing list (E-mail) Subject: Re: [PHP] What's more common: CGI or module installation? > You're probably looking for this: > > <!-- hello.inc --> > Hello, world! > > <!-- http://www.murphatnight.com/test.php --> > <HTML> > <BODY> > <? include "hello.inc" ?> > </BODY> > </HTML> --- Sure, that'd work but you renamed test.html to test.php and I'm afraid I'm stuck with the .html extension because my server installed PHP as CGI instead of as a module. Now, John Coggeshall and David Rose had something interesting to write in a previous thread labeled "Calling PHP from an HTML page" that I think would be useful. I suppose I should reiterate that I'm trying to help out my father whose server doesn't have PHP on it. So, he's stuck with flat HTML files. I'd like to help him write interactive HTML files that would flow something like: Read Daddy's page one halfway \ \ Enter me with fat, greasy PHP script / / Daddy's Page One (other half) with PHP content Kind of like sticking a CGI script in there that reads back into his original Page One. I know I'm missing something so basic that it makes me want to scream and kick a small, furry animal. Someone hit me with a book or a "RTFM" reference before the Society for the Prevention of Cruelty to Animals finds me! A blue pill? Gee, I've never tried the blue ones before...

« previous php.general (#9349) next »