Forum Replies Created

Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter npanic

    (@npanic)

    Hello, if anyone facing the same issue i finded the fix !

    By default wordfence will try to get the database information from the wp-config.php file, and if you have a custom config, it will not find the DB variables.

    You need to add CONSTANTS in the wordfence-waf.php file :

    First add ‘define(‘WFWAF_STORAGE_ENGINE’, ‘mysqli’);’ in a new line under the ‘<?php’ tag.

    Then add :

    define(‘WFWAF_DB_NAME’, ‘db_name’);
    define(‘WFWAF_DB_USER’, ‘db_user’);
    define(‘WFWAF_DB_PASSWORD’, ‘db_password’);
    define(‘WFWAF_DB_HOST’, ‘127.0.0.1’);
    define(‘WFWAF_DB_CHARSET’, ‘utf8’);
    define(‘WFWAF_DB_COLLATE’, ”);
    define(‘WFWAF_TABLE_PREFIX’, ‘wp_’);

    And done ! Wordfence firewall will save data in the DB.

    To check if the config is good go in Wordfence > Tools > Diagnostics > Wordfence Firewall Current WAF configuration.

    If ‘Active WAF storage engine’ is set to ‘mysqli’ your done ??

    Thread Starter npanic

    (@npanic)

    Hi, thanks for the answer !

    The firewall is optimized, so i added in the /wordfence-waf.php file the line : define(‘WFWAF_STORAGE_ENGINE’, ‘mysqli’); after the <?php.

    Now on the firewall configuration i have this :

    Wordfence Firewall Current WAF configuration.

    • WAF auto prepend active : Yes
    • Configured WAF storage engine (WFWAF_STORAGE_ENGINE) : mysqli
    • Active WAF storage engine : file system
    • WAF log path : ~/wp-content/wflogs/
    • WAF subdirectory installation : No
    • wordfence-waf.php path : /var/www/html/wordfence-waf.php
    • WAF File Permissions : 0600 – using template
    • Recently removed wflogs files : None
    • WAF Loaded Successfully : Yes*

    As you can see i still have the ‘Active WAF storage enfine set to file system, does it mean that the data is saved in the DB or not ?

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