Support » Plugin: Wordfence Security - Firewall & Malware Scan » Wordfence files with no owner, causing thousands of errors.

  • Hi,

    I’m getting thousands of errors in my error_log file because of the following:

    [02-Nov-2016 16:23:15 UTC] Unable to open /home/HOSTACCOUNT/public_html/wp-content/wflogs/config.php for reading and writing.
    [02-Nov-2016 16:23:28 UTC] Unable to open /home/HOSTACCOUNT/public_html/wp-content/wflogs/config.php for reading and writing.
    [02-Nov-2016 16:23:37 UTC] Unable to open /home/HOSTACCOUNT/public_html/wp-content/wflogs/config.php for reading and writing.
    [02-Nov-2016 16:24:01 UTC] Unable to open /home/HOSTACCOUNT/public_html/wp-content/wflogs/config.php for reading and writing.

    It’s happening because Wordfence is re-creating the files but instead of them being owned by the root account / host account they have no owner assigned as you can see below:

    Picture of files with no owner

    I’ve instructed my hosts to change the ownership and after they changed them the errors stopped for a while but after 1~ day they returned 🙁

    What’s going on, why is it doing this and how do I fix it?

    Thanks

Viewing 8 replies - 1 through 8 (of 8 total)
  • Hi hyflex,
    are you triggering wp cron with a server side cron job directly via php? If so, that may explain why the permissions on the files are set incorrectly. If you are triggering wp-cron with a server side cron job you want to make sure it’s running via curl as this will trigger the cron job in the same way it would normally be triggered via WordPress.

    Let me know if that helps!

    Hi,

    It’s being triggered by WP-Cron via PHP. How can this be fixed?

    Thanks

    Hi hyflex,
    you need to run the server side cron job via curl. Then wp-cron will be run with the same user as the one WordPress is running as and the file permissions will remain intact. Exactly what the code is supposed to look like depends a bit on where you are adding it. Typically you would start with curl and then the URL. You can see an example here.

    Hi wfsa,

    What “server side cron job”, how can I do it… I know how to set server side cron jobs but I don’t see what file/url I should be running the curl on.

    Thanks

    Hi! Check to see if you already have a server side cron job that runs wp-cron.php. If so, change it to run via curl.

    Hi,

    I don’t have a server side cron setup at all, in my cPanel there aren’t any and as far as I am aware the hosting side doesn’t have any (unless when you install wordpress it does it automatically)

    So, there aren’t any?

    The fact that the ownership on the files is changed in what appears to be an “automagical” way indicates that something outside of WordPress is triggering the change of those files. They inherit ownership from whatever process is creating them. So something on your server is doing this. Typically it would be a server side cron job. Your cPanel should have “Cron jobs” section that you can inspect to make sure there are none set up there. Did you check with your host, if so, what did they say?

    Thanks!

    Hi,

    In my cPanel, there are no cron jobs setup in the “cron jobs” page.

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘Wordfence files with no owner, causing thousands of errors.’ is closed to new replies.