Cannot enable Prevent PHP Execution

I'm trying to apply Prevent PHP Execution tweak, but it appears again after refreshing page.
I've checked and .htaccess has been added to the /wp-content folder and contain needed rules.
What could be the cause?

  • Kasia Swiderska

    Hello F404,

    I have checked with our developer and it looks like the Apache server can be configured in a way that doesn't allow for overriding some settings.
    Can you contact your hosting provider and ask if that would be the case with your server?
    Defender adds the htaccess file inside wp-content with this content:

    ## WP Defender - Protect PHP Executed ##
    <Files *.php>
    Order allow,deny
    Deny from all
    ## WP Defender - End ##

    It should have permissions 644 and with that, it should prevent PHP Execution.

    Let me know what will they say.

    kind regards,

  • Nithin

    Hi F404,

    Hope you are doing good today. :slight_smile:

    - I can check server with configuration must be in Apache

    Not sure whether I understand you fully, you meant you checked with your hosting provider, and the Prevent PHP execution code should be in Apache configuration file? or whether they confirmed it should work fine when added inside .htaccess in your root folder?

    The permissions you have mentioned seems to be correct.

    -I have 4 different WordPress site in same server witch use defender, 2 site have this problem

    I tried to access your cPanel, but seems like we could only access by whitelisting our IPs? Support staffs only have dynamic IPs, so if possible, would appreciate, if you could temporarily disable that feature, so that we could access your site without any issue.

    If you still need an IP, please try whitelisting this IP:

    However, this is a Dynamic IP, so I'm not sure whether it'll stay same, or not during the ticket I could check the site via cPanel.

    Please reply back in this ticket once you have done this, so we could give a closer look. Have a great day ahead. :slight_smile:

    Best Regards,

  • Kasia Swiderska

    Hello F404,

    Note: Don't leave your login details on this ticket.
    Instead, you can send us your details using our contact form and the template below:

    Subject: "Attn: Kasia Swiderska"
    - Site URL
    - cPanel credentials (host/username/password)
    - Folder path to site in question
    - Link back to this thread for reference
    - Any other relevant urls/info

    IMPORTANT: Please make sure you select "I have a different question" for your topic, so it doesn't go back to the forums - this and the subject line ensure that it gets assigned to me.

    Please confirm here that you send those credentials

    kind regards,

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.