Skip to content

The folder exists, but files cannot be written inside

This guide applies when Vulnity does find its secure folder but cannot write files inside it.

Use it if WordPress shows a warning similar to:

  • Vulnity found the secure firewall storage directory, but it could not write files inside it...
  • Vulnity found its secure log storage directory, but it could not write files inside it...

The folder already exists, but PHP cannot save files inside it.

The main path is:

wp-content/vulnity-data/

Vulnity needs these subfolders:

wp-content/vulnity-data/firewall/
wp-content/vulnity-data/logs/

Fix write permissions on these paths:

wp-content/vulnity-data/
wp-content/vulnity-data/firewall/
wp-content/vulnity-data/logs/
  1. Open your hosting file manager.
  2. Enter the WordPress installation.
  3. Go to wp-content/.
  4. Open vulnity-data/.
  5. Change permissions for:
    • vulnity-data
    • firewall
    • logs
  6. Try first with:
755
  1. If it still fails, try:
775
  1. Reload the WordPress panel.

The issue is probably not the numeric permission, but the owner or group.

Typical example:

  • wp-content/ belongs to user:user
  • wp-content/vulnity-data/logs/ belongs to root:root

In that case, PHP may still be unable to write even if the folder has 775.

From the WordPress root:

Terminal window
chmod 755 wp-content/vulnity-data
chmod 755 wp-content/vulnity-data/firewall
chmod 755 wp-content/vulnity-data/logs

If the warning still appears:

Terminal window
chmod 775 wp-content/vulnity-data
chmod 775 wp-content/vulnity-data/firewall
chmod 775 wp-content/vulnity-data/logs

The owner should not be root; it should match the owner of the other folders.

Terminal window
stat -c '%U %G %n' wp-content wp-content/vulnity-data wp-content/vulnity-data/firewall wp-content/vulnity-data/logs

Ideally, vulnity-data, firewall, and logs should have the same owner/group as wp-content.

If you know the correct user:

Terminal window
chown -R <user>:<group> wp-content/vulnity-data

Example:

Terminal window
chown -R user:user wp-content/vulnity-data

At that point, the problem is usually the directory owner or group, not the permission number.

You can send this to your hosting provider:

!!! info “Message for support” I have the Vulnity plugin installed on WordPress. The wp-content/vulnity-data/ folder already exists, but PHP cannot write inside it. I need write permissions for the user or process running PHP on wp-content/vulnity-data/, wp-content/vulnity-data/firewall/, and wp-content/vulnity-data/logs/.

When fixed:

  • The Vulnity warning disappears.
  • The plugin can create or update:
wp-content/vulnity-data/firewall/blocks.php
wp-content/vulnity-data/logs/vulnity-log.php
  • You do not need to change Apache.
  • You do not need to change Nginx.
  • You do not need to change anything in uploads.
  • You do not need to use 777 except as a very short temporary test.