hi, I'm totally new to this so pls excuse if this is not the right place to post this. i have a Apache web server on linux machine and in some folders i want to block uploading PHP files for some user groups(connect through ftp). so only static files will be available in that folder (administrator may upload PHP files in same folder) is there a way to do this. pls advice rgds asela
Put this in a .htaccess file (make sure the user cannot delete it..) in the root dir: <IfModule mod_php4.c> php_flag engine off </IfModule> <IfModule mod_php5.c> php_flag engine off </IfModule> Code (markup): Or in httpd.conf <Directory "/home/user/public_html/directory"> php_flag engine off </Directory> Or in the user's php.ini if you're using phpsuexec engine=off
yes it's a dedicated server. i have done the given changes in httpd.conf file earlier. it stop executing php in same folder. but if i put a xhtml file with php links to another folder, the execution was not as expected. it asks to save the file in the mobile device than showing the content in the file. does the "Or in the user's php.ini if you're using phpsuexec engine=off" option disable php in all folders except the required folder? i haven't try the htaccess option yet.
The aboce option will off the php engine so it will not execute .. As there is no setting for the mime type to identify this as php file it will ask for saving the file.
is there any other alternative methods to block uploading php files in a folder. if possible to block certain user group from uploading php files to a certain folder through FTP then that's enough for the time being. pls help someone thanks
this is what i have understood. create a file name .htaccess in the required folder and paste the below code in it. but seems it doesn't working. do i have to restart the service or make any other changes?