Defender says unable to install .htaccess but it did, unable to continue

Last couple of site I've tried to install on I get shut down by these same errors you can see in screenshots. Maybe I'm doing something wrong?

  • James Morris
    • WordPress Enthusiast

    Hello Erik,

    I hope you are well today.

    Looking at the error you posted (the last image in particular), it looks as though the permissions on .htaccess are restricting PHP from writing to the file.

    Could you please check the chmod (read/write) and chown (ownership) permissions on your .htaccess file? For Defender to write to it, it needs to be at least chmod 604 or 644.

    Best regards,

    James Morris

  • Luís
    • Support

    Hi Erik ,

    Hope you're doing well today and thanks for your patience here!

    Can you please check the permissions of the "wp-includes" folder? By default it should be "755".

    https://premium.wpmudev.org/blog/understanding-file-permissions/

    https://codex.wordpress.org/Changing_File_Permissions

    If this doesn't solve your issue, can you please send us the FTP details of your website, so we can investigate further? Please send it privately through our contact form:

    https://premium.wpmudev.org/contact/#i-have-a-different-question

    Send in:
    Subject: "Attn: Luis Lopes"
    - WordPress admin username
    - WordPress admin password
    - Login url
    - FTP credentials (host/username/password)
    - Link back to this thread for reference
    - Any other relevant urls/information

    Cheers, Luís

  • James Morris
    • WordPress Enthusiast

    Hello Erik,

    Thank you for getting back to us.

    Yes, this very well may be causing the problem. This may be a security measure they have implemented in their system on their Managed WordPress accounts to enhance security. Given that the directory has a chmod of 555, this means that the owner, group and world can read the directory contents, but none of these can write to the directory. Since the owner can't write to the directory, neither can any software running as the owner (in this case WordPress and Defender).

    So, in this particular situation, to add this to your site, you will need to contact the host and ask them to either add the file for you, or relax the permissions to 755 for folders and 644 for files.

    I hope this clarifies a bit.

    Best regards,

    James Morris

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.