PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
Moderator: General Moderators
asela_05085
Forum Newbie
Posts: 16 Joined: Mon Aug 31, 2009 10:33 pm
Post
by asela_05085 » Fri Sep 04, 2009 2:43 am
hi,
can i disable PHP in folder wise(i.e : in folders, where i need to disable PHP functionality)
thanks
Mirge
Forum Contributor
Posts: 298 Joined: Thu Sep 03, 2009 11:39 pm
Post
by Mirge » Fri Sep 04, 2009 11:10 am
John Cartwright
Site Admin
Posts: 11470 Joined: Tue Dec 23, 2003 2:10 am
Location: Toronto
Contact:
Post
by John Cartwright » Fri Sep 04, 2009 12:05 pm
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.
asela_05085
Forum Newbie
Posts: 16 Joined: Mon Aug 31, 2009 10:33 pm
Post
by asela_05085 » Mon Sep 07, 2009 5:10 am
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
dude81
Forum Regular
Posts: 509 Joined: Mon Aug 29, 2005 6:26 am
Location: Pearls City
Post
by dude81 » Mon Sep 07, 2009 9:39 am
there should be a way using .htaccess to make php_engine off. Hope that helps
asela_05085
Forum Newbie
Posts: 16 Joined: Mon Aug 31, 2009 10:33 pm
Post
by asela_05085 » Mon Sep 07, 2009 10:43 pm
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
dude81
Forum Regular
Posts: 509 Joined: Mon Aug 29, 2005 6:26 am
Location: Pearls City
Post
by dude81 » Tue Sep 08, 2009 12:50 am
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
asela_05085
Forum Newbie
Posts: 16 Joined: Mon Aug 31, 2009 10:33 pm
Post
by asela_05085 » Tue Sep 08, 2009 1:17 am
no luck with that. I'm wondering why it didn't work
dude81, have you tried that previously?
dude81
Forum Regular
Posts: 509 Joined: Mon Aug 29, 2005 6:26 am
Location: Pearls City
Post
by dude81 » Tue Sep 08, 2009 1:33 am
None of them worked?
or
and restarted apache. I remember using them some long time back
[*]
The last one was working for me..., I just checked