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.
When to use this guide
Section titled “When to use this guide”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...
What it means
Section titled “What it means”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/Fastest solution
Section titled “Fastest solution”Manually create the required directories with the correct permissions.
Hosting-panel solution
Section titled “Hosting-panel solution”- Open your hosting file manager.
- Navigate to your WordPress installation.
- Open
wp-content/. - Create the folder:
vulnity-data. - Inside
vulnity-data, create:firewallandlogs. - Set permissions to
755for all three folders. - If that does not work, try
775. - Reload the WordPress panel.
If 775 still fails
Section titled “If 775 still fails”There may be ownership conflicts. Example:
wp-content/belongs touser:uservulnity-data/belongs toroot:root
This mismatch prevents Vulnity from accessing the files.
SSH solution
Section titled “SSH solution”From the WordPress root:
mkdir -p wp-content/vulnity-data/firewallmkdir -p wp-content/vulnity-data/logschmod 755 wp-content/vulnity-datachmod 755 wp-content/vulnity-data/firewallchmod 755 wp-content/vulnity-data/logsIf it still fails:
chmod 775 wp-content/vulnity-datachmod 775 wp-content/vulnity-data/firewallchmod 775 wp-content/vulnity-data/logsThe owner must match wp-content/; it should not be root.
Check owner
Section titled “Check owner”stat -c '%U %G %n' wp-content wp-content/vulnity-data wp-content/vulnity-data/firewall wp-content/vulnity-data/logsFix owner
Section titled “Fix owner”chown -R <user>:<group> wp-content/vulnity-dataExample:
chown -R user:user wp-content/vulnity-dataIf the problem persists
Section titled “If the problem persists”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.
Verification
Section titled “Verification”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.phpwp-content/vulnity-data/logs/vulnity-log.php
No need to modify
Section titled “No need to modify”- Apache configuration.
- Nginx configuration.
- The
uploadsfolder — unless the message you see mentionswp-content/uploads/vulnity-data, which is a different folder with its own guide. - The plugins directory.