• Resolved cnbsorg

    (@cnbsorg)


    Hi,

    I am trying to optimize the firewall, but keep getting:

    We were unable to create the wordfence-waf.php file in the root of the WordPress installation. It's possible WordPress cannot write to the wordfence-waf.php file because of file permissions. Please verify the permissions are correct and retry the installation.

    I checked in WF Diagnostics Tool, Process Owner: apache
    Which is also the owner of /var/www/html , as well as all sub directories including the root of course.

    I even tried 777 on /var/www/html, still didn’t work.

    Any idea how to keep debugging? I read every single relevant thread on the internet but didn’t find any solution for this, I am probably missing something here.

    Thank you.

    The page I need help with: [log in to see the link]

Viewing 14 replies - 16 through 29 (of 29 total)
  • @cnbsorg

    Can you access phpMyAdmin?

    Thread Starter cnbsorg

    (@cnbsorg)

    Hi (sorry for the late reply),

    I do have access to phpMyAdmin, should I remove WF again and make sure all its files are removed + all db tables are removed?

    Any special instructions? or just delete the obvious? (DB tables and WF directory, if anything last after I delete the plugin from WordPress admin panel).

    I Will try it now and reply again, please let me know if special attention is needed for anything here.

    Thank you.

    Thread Starter cnbsorg

    (@cnbsorg)

    I deactivated Wordfence after checking “Delete Wordfence tables and data on deactivation”, then deleted it from the Plug ins admin menu.

    Checked the file system, both WordFence and wflogs directories were gone.
    I also checked phpmyadmin, all wf tables were deleted, so I didn’t have to delete anything manually.

    Installed it again, clicked on “Optimize Wordfence Firewall”, and got exactly the same message again.

    Any idea how to debug / proceed from here?

    Thank you.

    Thread Starter cnbsorg

    (@cnbsorg)

    I also cleared all cache, and tried from another unused browser, still getting the same message.

    Thread Starter cnbsorg

    (@cnbsorg)

    Anyone? ??

    @cnbsorg

    Note: check the “wp_options” table phpMyAdmin. Confident there will be some WF entries in there.

    Again, If you need a hand let me know…

    Thread Starter cnbsorg

    (@cnbsorg)

    The only entry related to WF in this table is “wf_plugin_act_error” and it has no value (I didn’t deleted WF, just checked this table).

    Can we please go back to debugging the problem itself? ??

    We were unable to create the wordfence-waf.php file in the root of the WordPress installation.

    This means that new files cannot be written to the main folder of your site.

    The /var/www/html/ folder owner is apache, same as noted in WF Diagnostics Tool Process Owner, /var/www/html/ is 775.

    Other plugins write to this directory with no problems, for example I can see .htacess file was modified by the cache plugin.

    What could it be?
    Maybe Wordfence is trying to write to a different category?

    Please advice how to debug, I don’t have any ideas left..

    Thank you.

    • This reply was modified 5 years, 9 months ago by cnbsorg.
    Thread Starter cnbsorg

    (@cnbsorg)

    Oh my bad, now I see more entries with “wordfence” prefix, will try to delete everything one more time.

    Thread Starter cnbsorg

    (@cnbsorg)

    I deactivated Wordfence after checking “Delete Wordfence tables and data on deactivation”, then deleted it from the Plug ins admin menu, deleted few “wf” and “wordfence” related entries from “wp_options” table, reinstalled again – got the same error.

    Time to give up? ??

    Thread Starter cnbsorg

    (@cnbsorg)

    Tried it, nothing changed in the Diagnostics Tool:

    Filesystem Ability to read/write various files. 
    Checking if web server can read from ~/plugins/wordfence
    OK
    Checking if web server can write to ~/plugins/wordfence
    OK
    Checking if web server can read from ~/wp-content/wflogs
    OK
    Checking if web server can write to ~/wp-content/wflogs
    OK

    Still getting the same error..

    • This reply was modified 5 years, 9 months ago by cnbsorg.
    Thread Starter cnbsorg

    (@cnbsorg)

    What will happen if I just crate an empty wordfence-waf.php in the root myself? will it break stuff?

    • This reply was modified 5 years, 9 months ago by cnbsorg.
    Thread Starter cnbsorg

    (@cnbsorg)

    The problem was SELinux in case anyone is interested.

    Turning it off with “setenforce permissive” did the trick (thanks to Wordfence Premium Support).

    After finishing the firewall optimization, SELinux can be turned on again with “setenforce enforcing”.

    Hope it helps someone.

    OMG just wasted about 2 hours until I read @cnbsorg – completely forgot about SELinux! Fixed my problem too.

Viewing 14 replies - 16 through 29 (of 29 total)
  • The topic ‘Unable to create the wordfence-waf.php’ is closed to new replies.