RE: [PHP] Turning off PHP for one directory with apache

From: Date: Tue, 23 Jan 2001 04:49:34 +0000
Subject: RE: [PHP] Turning off PHP for one directory with apache
Groups: php.general 
Request: Send a blank email to php-general+get-36140@lists.php.net to get a copy of this message
---------------------------------------------------------------------------- ----------------- 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

« previous php.general (#36140) next »