Skip to content

Cannot create the secure folder

Vulnity Security stores firewall state and logs in a secure folder inside wp-content/. This guide covers the warning shown when PHP cannot create that folder.

Use this guide if WordPress shows messages such as:

  • Vulnity could not create the secure firewall storage directory...
  • Vulnity could not create its secure log storage directory...

PHP does not have permission to create directories inside wp-content/. Vulnity needs:

wp-content/vulnity-data/

With these subfolders:

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

Manually create the required directories with the correct permissions.

  1. Open your hosting file manager.
  2. Navigate to your WordPress installation.
  3. Open wp-content/.
  4. Create the folder: vulnity-data.
  5. Inside vulnity-data, create: firewall and logs.
  6. Set permissions to 755 for all three folders.
  7. If that does not work, try 775.
  8. Reload the WordPress panel.

There may be ownership conflicts. Example:

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

This mismatch prevents Vulnity from accessing the files.

From the WordPress root:

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

If it still fails:

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

The owner must match wp-content/; it should not be root.

Terminal window
stat -c '%U %G %n' wp-content wp-content/vulnity-data wp-content/vulnity-data/firewall wp-content/vulnity-data/logs
Terminal window
chown -R <user>:<group> wp-content/vulnity-data

Example:

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

The issue is probably in wp-content/ itself, not in vulnity-data. Contact your hosting provider with this message:

Vulnity tries to repair this automatically

Section titled “Vulnity tries to repair this automatically”

On every admin page load — and, since plugin 1.4.0, on every heartbeat (about every 6 hours) — Vulnity retries creating the folders and lifting their permissions (chmod 755). If the underlying ownership problem gets fixed, the warning clears itself on the next check, and the warning badge in the Vulnity panel clears with the next heartbeat. Manual steps are only needed when PHP genuinely lacks the rights to create or write these folders.

Signs of success:

  • The warning disappears.
  • These directories exist:
    • wp-content/vulnity-data/
    • wp-content/vulnity-data/firewall/
    • wp-content/vulnity-data/logs/
  • Vulnity creates:
    • wp-content/vulnity-data/firewall/blocks.php
    • wp-content/vulnity-data/logs/vulnity-log.php
  • Apache configuration.
  • Nginx configuration.
  • The uploads folder — unless the message you see mentions wp-content/uploads/vulnity-data, which is a different folder with its own guide.
  • The plugins directory.