Title: Disable PHP in Uploads
Last modified: August 31, 2016

---

# Disable PHP in Uploads

 *  Resolved [Sergey9999](https://wordpress.org/support/users/sergey9999/)
 * (@sergey9999)
 * [10 years, 1 month ago](https://wordpress.org/support/topic/disable-php-in-uploads/)
 * Hello.
 * When i Disable PHP in Uploads i have error 500. Same problem with “Enable HackRepair.
   com’s blacklist feature”
 * What ways i have to resolve this problem?
 * [https://wordpress.org/plugins/better-wp-security/](https://wordpress.org/plugins/better-wp-security/)

Viewing 11 replies - 1 through 11 (of 11 total)

 *  [dwinden](https://wordpress.org/support/users/dwinden/)
 * (@dwinden)
 * [10 years, 1 month ago](https://wordpress.org/support/topic/disable-php-in-uploads/#post-7217811)
 * [@sergey9999](https://wordpress.org/support/users/sergey9999/)
 * What web server and what version of that web server are you using ?
 * This issue could be due to using an old Apache 1.3.x release.
    Check the Apache
   error_log for an error that looks like this:
 * >  RewriteRule: cannot compile regular expression ‘^wp-content/uploads/.*\\.(?:
   > php[1-6]?|pht|phtml?)$’\n
 * dwinden
 *  Thread Starter [Sergey9999](https://wordpress.org/support/users/sergey9999/)
 * (@sergey9999)
 * [10 years, 1 month ago](https://wordpress.org/support/topic/disable-php-in-uploads/#post-7217963)
 * I have newest version of nginx. Which module(s) can use these function?
 *  [dwinden](https://wordpress.org/support/users/dwinden/)
 * (@dwinden)
 * [10 years, 1 month ago](https://wordpress.org/support/topic/disable-php-in-uploads/#post-7217964)
 * [@sergey9999](https://wordpress.org/support/users/sergey9999/)
 * What is the newest version of Nginx ?
 * dwinden
 *  Thread Starter [Sergey9999](https://wordpress.org/support/users/sergey9999/)
 * (@sergey9999)
 * [10 years, 1 month ago](https://wordpress.org/support/topic/disable-php-in-uploads/#post-7217965)
 * nginx-1.9.13
 * Maybe need to turn on some php modules?
 *  [dwinden](https://wordpress.org/support/users/dwinden/)
 * (@dwinden)
 * [10 years, 1 month ago](https://wordpress.org/support/topic/disable-php-in-uploads/#post-7217977)
 * [@sergey9999](https://wordpress.org/support/users/sergey9999/)
 * I don’t think you need to turn on any php modules.
    Are there any errors in the
   error_log file ?
 * dwinden
 *  Thread Starter [Sergey9999](https://wordpress.org/support/users/sergey9999/)
 * (@sergey9999)
 * [10 years, 1 month ago](https://wordpress.org/support/topic/disable-php-in-uploads/#post-7217983)
 * I make that changes (as my first post) initially for to see error in log. Error
   log file have only one type data is:
 * ” [‘my time’] [alert] [client my ip adress] /home/mysite/mysite.com/docs/.htaccess:
   RewriteRule: cannot compile regular expression ‘^wp\\-content/uploads/.*\\.(?:
   php[1-6]?|pht|phtml?)$’\n “
 * Note. But when i delete code:
 * # Disable PHP in Uploads – Security > Settings > System Tweaks > Uploads
    RewriteRule
   ^wp\-content/uploads/.*\.(?:php[1-6]?|pht|phtml?)$ – [NC,F]”
 * from .htaccess the site have not that error 500.
 * What do you think about this? What solution we have?
 *  Thread Starter [Sergey9999](https://wordpress.org/support/users/sergey9999/)
 * (@sergey9999)
 * [10 years, 1 month ago](https://wordpress.org/support/topic/disable-php-in-uploads/#post-7217984)
 * The code in .htaccess when i copy is correct. A quotes was whrote when i type
   message for you.
 *  [dwinden](https://wordpress.org/support/users/dwinden/)
 * (@dwinden)
 * [10 years, 1 month ago](https://wordpress.org/support/topic/disable-php-in-uploads/#post-7217985)
 * [@sergey9999](https://wordpress.org/support/users/sergey9999/)
 * It looks like your WordPress site is not using Nginx but Apache web server.
 * Follow these instructions to find out which web server your WordPress site is
   using:
 * – log into WP Dashboard.
    – navigate to the Security->Dashboard menu option. –
   Scroll down to the **System Information** metabox. – Look for **Server Type:**
   in the **Server Information** section.
 * It will probably not show the version, just Apache. You may need to contact your
   hosting provider to get the web server version.
    Anyway I’m pretty sure its Apache
   1.3.x. I’ve seen this issue before… This is an Apache 1.3.x specific issue.
 * dwinden
 *  Thread Starter [Sergey9999](https://wordpress.org/support/users/sergey9999/)
 * (@sergey9999)
 * [10 years, 1 month ago](https://wordpress.org/support/topic/disable-php-in-uploads/#post-7217986)
 * Dwinden, you are absolutly right. I have Apache/1.3.42 (Unix) PHP/5.3.13.
 * Could you please help me find this solution where you had seen it before?
    Forum
   have so many topics, and my english not good as yours.
 * I will be very appriciate you and mark this topic as “resolved”.
 *  [dwinden](https://wordpress.org/support/users/dwinden/)
 * (@dwinden)
 * [10 years, 1 month ago](https://wordpress.org/support/topic/disable-php-in-uploads/#post-7217987)
 * [@sergey9999](https://wordpress.org/support/users/sergey9999/)
 * You can find a specific fix for the **Disable PHP in Uploads** issue in [this](https://wordpress.org/support/topic/500-internal-server-error-432)
   topic.
 * The general idea behind the fix above also applies for the HackRepair.com Blacklist.
   Only difference is that it needs to be fixed in a different file:
 * wp-content/plugins/better-wp-security/core/modules/ban-users/lists/hackrepair-
   apache.inc
 * dwinden
 *  Thread Starter [Sergey9999](https://wordpress.org/support/users/sergey9999/)
 * (@sergey9999)
 * [10 years, 1 month ago](https://wordpress.org/support/topic/disable-php-in-uploads/#post-7217991)
 * Thank you i will try!

Viewing 11 replies - 1 through 11 (of 11 total)

The topic ‘Disable PHP in Uploads’ is closed to new replies.

 * ![](https://ps.w.org/better-wp-security/assets/icon.svg?rev=3529351)
 * [Kadence Security – Password, Two Factor Authentication, and Brute Force Protection](https://wordpress.org/plugins/better-wp-security/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/better-wp-security/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/better-wp-security/)
 * [Active Topics](https://wordpress.org/support/plugin/better-wp-security/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/better-wp-security/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/better-wp-security/reviews/)

## Tags

 * [settings](https://wordpress.org/support/topic-tag/settings/)

 * 11 replies
 * 2 participants
 * Last reply from: [Sergey9999](https://wordpress.org/support/users/sergey9999/)
 * Last activity: [10 years, 1 month ago](https://wordpress.org/support/topic/disable-php-in-uploads/#post-7217991)
 * Status: resolved