Title: wfWAFStorageFileException
Last modified: September 1, 2016

---

# wfWAFStorageFileException

 *  Resolved [rabmcnab](https://wordpress.org/support/users/rabmcnab/)
 * (@rabmcnab)
 * [9 years, 11 months ago](https://wordpress.org/support/topic/wfwafstoragefileexception/)
 * I had to manually rename the wordfence plugin folder name for a large number 
   of sites this morning.
 * They are all on various DigitalOcean droplets running Centos 6.7 and Apache.
 * White Screen of Death on frontend and backend of all sites.
 * The stacktrace is;
 * `Fatal error: Uncaught exception 'wfWAFStorageFileException' with message 'Unable
   to open /var/www/vhosts/domain.com/public/wp-content/wflogs/ips.php for reading
   and writing.' in /var/www/vhosts/domain.com/public/wp-content/plugins/wordfence/
   vendor/wordfence/wf-waf/src/lib/storage/file.php:355 Stack trace: #0 /var/www/
   vhosts/domain.com/public/wp-content/plugins/wordfence/vendor/wordfence/wf-waf/
   src/lib/storage/file.php(452): wfWAFStorageFile->open() #1 /var/www/vhosts/domain.
   com/public/wp-content/plugins/wordfence/vendor/wordfence/wf-waf/src/lib/storage/
   file.php(409): wfWAFStorageFile->fetchConfigData() #2 /var/www/vhosts/domain.
   com/public/wp-content/plugins/wordfence/lib/wordfenceClass.php(729): wfWAFStorageFile-
   >getConfig('wafStatus') #3 [internal function]: wordfence::enqueueAJAXWatcher('')#
   4 /var/www/vhosts/domain.com/public/wp-includes/plugin.php(525): call_user_func_array('
   wordfence::enqu...', Array) #5 /var/www/vhosts/domain.com/public/wp-includes/
   script-loader.php(1076): do_action('wp_enqueue_scri...') #6 [ in /var/www/vhosts/
   domain.com/public/wp-content/plugins/wordfence/vendor/wordfence/wf-waf/src/lib/
   storage/file.php on line 355`
 * I temporarily set the wflogs direcotory to 777 permissions it didn’t help.
 * I’ve deactivated Wordfence on all blogs, interested to see if anyone else has
   this exact issue.
 * [https://wordpress.org/plugins/wordfence/](https://wordpress.org/plugins/wordfence/)

Viewing 13 replies - 1 through 13 (of 13 total)

 *  Thread Starter [rabmcnab](https://wordpress.org/support/users/rabmcnab/)
 * (@rabmcnab)
 * [9 years, 11 months ago](https://wordpress.org/support/topic/wfwafstoragefileexception/#post-7505280)
 * I can confirm this has been introduced in 6.1.9
 * I download and manually uploaded 6.1.9 – same stack trace as above, site dysfunctional.
 * Downloaded 6.1.8 and uploaded. Sites back up.
 * [https://downloads.wordpress.org/plugin/wordfence.6.1.8.zip](https://downloads.wordpress.org/plugin/wordfence.6.1.8.zip)
 * Rollback manually and wait for 6.1.10.
 *  Thread Starter [rabmcnab](https://wordpress.org/support/users/rabmcnab/)
 * (@rabmcnab)
 * [9 years, 11 months ago](https://wordpress.org/support/topic/wfwafstoragefileexception/#post-7505291)
 * Further to this. It’s the changes you’ve made to the following file that’s causing
   this issue;
 * **lib/wordfenceClass.php**
 *  [fletj](https://wordpress.org/support/users/fletj/)
 * (@fletj)
 * [9 years, 11 months ago](https://wordpress.org/support/topic/wfwafstoragefileexception/#post-7505355)
 * I cannot get into my site at all, so cannot disable Wordfence nor revert back
   to an earlier version. I have not made any changes to any Wordfence files:
 * Fatal error: Uncaught exception ‘wfWAFStorageFileConfigException’ with message‘
   Error reading Wordfence Firewall config data, configuration file could be corrupted
   or inaccessible. Path: /home/johnfle1/public_html/wp-content/wflogs/config.php’
   in /home/johnfle1/public_html/wp-content/plugins/wordfence/vendor/wordfence/wf-
   waf/src/lib/storage/file.php:465 Stack trace: #0 /home/johnfle1/public_html/wp-
   content/plugins/wordfence/vendor/wordfence/wf-waf/src/lib/storage/file.php(409):
   wfWAFStorageFile->fetchConfigData() #1 /home/johnfle1/public_html/wp-content/
   plugins/wordfence/lib/wordfenceClass.php(729): wfWAFStorageFile->getConfig(‘wafStatus’)#
   2 [internal function]: wordfence::enqueueAJAXWatcher(”) #3 /home/johnfle1/public_html/
   wp-includes/plugin.php(525): call_user_func_array(‘wordfence::enqu…’, Array) #
   4 /home/johnfle1/public_html/wp-includes/script-loader.php(1076): do_action(‘
   wp_enqueue_scri…’) #5 [internal function]: wp_enqueue_scripts(”) #6 /home/johnfle1/
   public_html/wp-includes/plugin.php(525): call_user_func_ar in /home/johnfle1/
   public_html/wp-content/plugins/wordfence/vendor/wordfence/wf-waf/src/lib/storage/
   file.php on line 465
 * Help
 * JohnF
 *  Thread Starter [rabmcnab](https://wordpress.org/support/users/rabmcnab/)
 * (@rabmcnab)
 * [9 years, 11 months ago](https://wordpress.org/support/topic/wfwafstoragefileexception/#post-7505357)
 * The problem is this change to `public static function enqueueAJAXWatcher` in
 * **lib/wordfenceClass.php**
 * OLD
 *     ```
       public static function enqueueAJAXWatcher() {
           if (wfUtils::isAdmin()) {
               wp_enqueue_style('wordfence-colorbox-style', wfUtils::getBaseURL() . 'css/colorbox.css', '', WORDFENCE_VERSION);
               wp_enqueue_script('jquery.wfcolorbox', wfUtils::getBaseURL() . 'js/jquery.colorbox-min.js', array('jquery'), WORDFENCE_VERSION);
               wp_enqueue_script('wordfenceAJAXjs', wfUtils::getBaseURL() . 'js/admin.ajaxWatcher.js', array('jquery'), WORDFENCE_VERSION);
           }
       }
       ```
   
 * And NEW which breaks the sites (and having seen a few threads on this it’s nothing
   to do with PHP version I think – I’ve seen PHP5.3.3 through to to versions of
   PHP 5.5). Users reporting this on shared hosting, VPS and dedicated.
 *     ```
       public static function enqueueAJAXWatcher() {
           $waf = wfWAF::getInstance();
           $config = $waf->getStorageEngine();
           $wafStatus = (!WFWAF_ENABLED ? 'disabled' : $config->getConfig('wafStatus'));
           if (wfUtils::isAdmin() && $wafStatus != 'disabled') {
               wp_enqueue_style('wordfenceAJAXcss', wfUtils::getBaseURL() . 'css/wordfenceBox.css', '', WORDFENCE_VERSION);
               wp_enqueue_script('wordfenceAJAXjs', wfUtils::getBaseURL() . 'js/admin.ajaxWatcher.js', array('jquery'), WORDFENCE_VERSION);
           }
       }
       ```
   
 *  Thread Starter [rabmcnab](https://wordpress.org/support/users/rabmcnab/)
 * (@rabmcnab)
 * [9 years, 11 months ago](https://wordpress.org/support/topic/wfwafstoragefileexception/#post-7505360)
 * [@fletj](https://wordpress.org/support/users/fletj/)
 * You’ll have to rename the `wp-content/plugins/wordfence` directory via FTP
 *  [Senuke](https://wordpress.org/support/users/cavor/)
 * (@cavor)
 * [9 years, 11 months ago](https://wordpress.org/support/topic/wfwafstoragefileexception/#post-7505374)
 * Same problem for me since latest version 6.1.9 on all my websites:
 * Fatal error: Uncaught exception ‘wfWAFStorageFileException’ with message ‘Unable
   to open /www/wp-content/wflogs/ips.php for reading and writing.’ in /wp-content/
   plugins/wordfence/vendor/wordfence/wf-waf/src/lib/storage/file.php:355 Stack 
   trace: #0 /www/wp-content/plugins/wordfence/vendor/wordfence/wf-waf/src/lib/storage/
   file.php(452): wfWAFStorageFile->open() #1 /www/wp-content/plugins/wordfence/
   vendor/wordfence/wf-waf/src/lib/storage/file.php(409): wfWAFStorageFile->fetchConfigData()#
   2 /www/wp-content/plugins/wordfence/lib/wordfenceClass.php(729): wfWAFStorageFile-
   >getConfig(‘wafStatus’) #3 [internal function]: wordfence::enqueueAJAXWatcher(‘
   plugins.php’) #4 /www/wp-includes/plugin.php(525): call_user_func_array(‘wordfence::
   enqu…’, Array) #5 /www/wp-admin/admin-header.php(92): do_action(‘admin_enqueue_s…’,‘
   plugins.php’) #6 /www/wp-admin/plugins.p in /www/wp-content/plugins/wordfence/
   vendor/wordfence/wf-waf/src/lib/storage/file.php on line 355
 *  [braican](https://wordpress.org/support/users/braican/)
 * (@braican)
 * [9 years, 11 months ago](https://wordpress.org/support/topic/wfwafstoragefileexception/#post-7505381)
 * Same issue here, updating sites to version 6.1.9 gets me that uncaught exception.
   My fix was to update the permissions on all the files in the wp-content/wflogs
   directory to ensure that Apache has read/write access to them. Doing this fixed
   the white screen issue.
 *  Thread Starter [rabmcnab](https://wordpress.org/support/users/rabmcnab/)
 * (@rabmcnab)
 * [9 years, 11 months ago](https://wordpress.org/support/topic/wfwafstoragefileexception/#post-7505392)
 * [@braican](https://wordpress.org/support/users/braican/)
 * Lol, I realise that I didn’t read the original stack properly and created the
   writable wflogs directory in the wrong place. D’oh.
 * As it happens I didn’t need to have this file writable by apache, I set permissions
   and group to the chrooted user/group that the site runs under. Initially had 
   to make it writable, after it had created the php files (php files in a logging
   directory in wp-content??) I could set it back to 755 and all seems fine.
 *  [WFSupport](https://wordpress.org/support/users/wfsupport/)
 * (@wfsupport)
 * [9 years, 11 months ago](https://wordpress.org/support/topic/wfwafstoragefileexception/#post-7505393)
 * We’re working on a fix now that should be released later today.
 * The white screen or wfWAFStorageFileException error means that wflogs or wflogs/
   config.php isn’t readable or doesn’t exist. The site can be fixed by adjusting
   file permissions so the web server can read/write those files, if possible, or
   by adding these two lines to the theme’s functions.php:
 * _remove\_action(‘wp\_enqueue\_scripts’, ‘wordfence::enqueueAJAXWatcher’);
    remove\
   _action(‘admin\_enqueue\_scripts’, ‘wordfence::enqueueAJAXWatcher’);  The two
   lines can be removed after the new update is released.
 *  Thread Starter [rabmcnab](https://wordpress.org/support/users/rabmcnab/)
 * (@rabmcnab)
 * [9 years, 11 months ago](https://wordpress.org/support/topic/wfwafstoragefileexception/#post-7505397)
 * OK, thanks [@wfsupport](https://wordpress.org/support/users/wfsupport/)
 * Good luck today, might be quite a busy one for you I think 😉
 *  [jesseamber](https://wordpress.org/support/users/jesseamber/)
 * (@jesseamber)
 * [9 years, 11 months ago](https://wordpress.org/support/topic/wfwafstoragefileexception/#post-7505408)
 * [oops, ignore me]
 *  [Senuke](https://wordpress.org/support/users/cavor/)
 * (@cavor)
 * [9 years, 11 months ago](https://wordpress.org/support/topic/wfwafstoragefileexception/#post-7505449)
 * Thank you for quick patch, works perfectly now 🙂
 *  [tenfef](https://wordpress.org/support/users/tenfef/)
 * (@tenfef)
 * [9 years, 3 months ago](https://wordpress.org/support/topic/wfwafstoragefileexception/#post-8746122)
 * This error was happening to me when the host ran out of disk and couldn’t write
   a temporary file.

Viewing 13 replies - 1 through 13 (of 13 total)

The topic ‘wfWAFStorageFileException’ is closed to new replies.

 * ![](https://ps.w.org/wordfence/assets/icon.svg?rev=2070865)
 * [Wordfence Security - Firewall, Malware Scan, and Login Security](https://wordpress.org/plugins/wordfence/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/wordfence/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/wordfence/)
 * [Active Topics](https://wordpress.org/support/plugin/wordfence/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/wordfence/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/wordfence/reviews/)

 * 13 replies
 * 7 participants
 * Last reply from: [tenfef](https://wordpress.org/support/users/tenfef/)
 * Last activity: [9 years, 3 months ago](https://wordpress.org/support/topic/wfwafstoragefileexception/#post-8746122)
 * Status: resolved