Page 1 of 1

Blocking PHP access

Posted: Fri Sep 04, 2009 2:43 am
by asela_05085
hi,

can i disable PHP in folder wise(i.e : in folders, where i need to disable PHP functionality)

thanks :( :(

Re: Blocking PHP access

Posted: Fri Sep 04, 2009 11:10 am
by Mirge
Haven't tried it, but worth a shot: http://www.faqts.com/knowledge_base/vie ... 128/fid/35

Re: Blocking PHP access

Posted: Fri Sep 04, 2009 12:05 pm
by John Cartwright
I'm pretty sure if you remove execute permission on the folder using chmod -- like 666 -- it will prevent any scripts from executing.

Test first though.

Re: Blocking PHP access

Posted: Mon Sep 07, 2009 5:10 am
by asela_05085
hi,

the chmod 666 option seems forbidden exciting .html files as well but i need to run .html files in those folders.

the http.conf option seems disable PHP globally. i.e not only in the intended folder

any idea pls :(

Re: Blocking PHP access

Posted: Mon Sep 07, 2009 9:39 am
by dude81
there should be a way using .htaccess to make php_engine off. Hope that helps

Re: Blocking PHP access

Posted: Mon Sep 07, 2009 10:43 pm
by asela_05085
yes i have heard about that. someone told me to put below line in .htaccess file
AddType text/plain .php

but it didn't work for me.
I'm not sure whether i have to make any further modifications (like restarting the server etc..)

pls advice

Re: Blocking PHP access

Posted: Tue Sep 08, 2009 12:50 am
by dude81
No that is not correct I believe, simply adding following line in .htaccess should be enough and restart the apache

php_engine off or
php_flag engine off

one of the above should work

Re: Blocking PHP access

Posted: Tue Sep 08, 2009 1:17 am
by asela_05085
no luck with that. I'm wondering why it didn't work :(
dude81, have you tried that previously?

Re: Blocking PHP access

Posted: Tue Sep 08, 2009 1:33 am
by dude81
None of them worked?

Code: Select all

 
php_engine off 
 
or

Code: Select all

 
php_flag engine off
 
and restarted apache. I remember using them some long time back
[*] The last one was working for me..., I just checked