By matter9 on
I'm trying to allow a simple php script (that has nothing to do with drupal) to run in a subdirectory, but apache won't run the script - it just returns the entire php file to the browser, which of course causes the browser to ask if you want to save it. I don't think the problem is with rewrite because the URL isn't rewritten - I can access the file. The problem is that apache doesn't execute the script. I've poured over the .htaccess and php.ini files but can't find anything that looks like it will enable the php script to run in a subdirectory. This script runs fine when it's outside of the drupal file system. Any help or pointers would be greatly appreciated.
TIA, Matt
Comments
Solved! SetHandler blocks execution of scripts in files folder
The solution to my problem was that there was a SetHandler directive in the files folder under the drupal folder, which had the following line
Once the SetHandler line is commented out, the script will execute. Of course, that leaves a security hole where others might put bad scripts, but that isn't an issue in this case.
Is there a better way?
Is there a way to allow/specify specific php files, while keeping the security handler in place?
Figured it out
in .htaccess, add:
Not working
hi drinkdecaf , i used code
SetHandler None
in .htaccess file. but its not working. i used my file xxxx.html file in sites/default/files/mynewfolder/detect/xxxx.html and i tried with so many ways like
SetHandler None
but not working.
Any suggestions regarding this.