Prevent PHP code execution in a folder with .htaccess

With this trick, we will be able to avoid the execution of PHP code in an specific folder of our Apache web server.

This is particularly handful in case of upload folders for example, as we will surely avoid exploits hidden in uploaded images.

The directive should be placed in a .htaccess file contained in the directory where we want to disable execution.

php_value engine off
Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s