Re: Turning off PHP for one directory with apache

From: Date: Tue, 23 Jan 2001 04:51:16 +0000
Subject: Re: Turning off PHP for one directory with apache
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-36141@lists.php.net to get a copy of this message
Instead of: > Action application/x-httpd-php-source "/php4/php.exe -s" > AddType application/x-httpd-php-source .php4 .php .inc .htm why not: > Action application/x-httpd-php-source "/php4/php.exe /path/to/showsource.php " > AddType application/x-httpd-php-source .php4 .php .inc .htm and using a php program that takes the input params and shows the source for whatever file you're trying to look at? I just pulled that out of my ass tho, dunno how viable it is as an idea or a server directive, somebody out there correct me? Gfunk - http://www.gfunk007.com/ I sense much beer in you. Beer leads to intoxication, intoxication to hangovers, and hangovers to... suffering. ----- Original Message ----- From: "Nold, Mark" <Mark.Nold@normandy.com.au> To: <dan@tangledhelix.com> Cc: "'Lewis Bergman'" <lbergman@abi.tconline.net>; "Php-General (E-mail)" <php-general@lists.php.net> Sent: Tuesday, January 23, 2001 3:49 PM Subject: RE: [PHP] Turning off PHP for one directory with apache > -------------------------------------------------------------------------- -- > ----------------- > Disclaimer: The information contained in this email is intended only for the > use of the person(s) to whom it is addressed and may be confidential or > contain legally privileged information. If you are not the intended > recipient you are hereby notified that any perusal, use, distribution, > copying or disclosure is strictly prohibited. If you have received this > email in error please immediately advise us by return email at > postmaster@normandy.com.au and delete the email document without making a > copy. > -------------------------------------------------------------------------- -- > ----------------- > You're right. > > Thats exactly what i wanted. If you imagine uploaded files, or attachments > to email in a PHP mailing list archive. You definatly wouldnt want them to > execute code, in the case of mailing list archives you'd probably want to > display em. > > Would anybody know how i can conigure Apache (with PHP as a CGI) to then > show these as PHP highlighted source? > > Ive tried (im using a windows box to test) > > Action application/x-httpd-php-source "/php4/php.exe -s" > AddType application/x-httpd-php-source .php4 .php .inc .htm > > Any ideas what im doing wrong? (I do have a vague memory of someone say you > couldnt use this feature with PHP as a CGI) > > Or can someone confirm its definatly not available in PHP as a CGI? > > mn > > > > > Mark Nold > markn@enspace.com <mailto:markn@enspace.com> > Senior Consultant > > Change is inevitable, except from vending machines. > > > > -----Original Message----- > From: Dan Lowe [mailto:dan@tangledhelix.com] > Sent: Tuesday, January 23, 2001 12:42 PM > To: Nold, Mark > Cc: 'Lewis Bergman'; Php-General (E-mail) > Subject: Re: [PHP] Turning off PHP for one directory with apache > > > Previously, Nold, Mark said: > > > > After a bit of further playing it appears that simply AddType with the > same > > extensions that were set up should also stop php from working. > > > > So in a .htaccess file you can just > > AddType text/plain .php4 .php .inc .htm > > Wouldn't that spit the source code out to the browser though? Personally > I would find that undesirable. > > You could also do something like this, should work in an .htaccess or in > the httpd.conf/access.conf files: > > # Stops .php .php3 .php4 > <Files ~ "^.*\.php?$"> > order allow,deny > deny from all > </Files> > # Stops .inc > <Files ~ "^.*\.inc$"> > order allow,deny > deny from all > </Files> > # Stops .htm .html > <Files ~ "^.*\.htm?$"> > order allow,deny > deny from all > </Files> > > -dan > > -- > Dan Lowe <dan@tangledhelix.com> http://tangledhelix.com/ > > Can vegetarians eat animal crackers? -George Carlin > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net > For additional commands, e-mail: php-general-help@lists.php.net > To contact the list administrators, e-mail: php-list-admin@lists.php.net >

« previous php.general (#36141) next »