Title: Scheduled Scan causes 500 error?
Last modified: March 2, 2026

---

# Scheduled Scan causes 500 error?

 *  Resolved [Liz](https://wordpress.org/support/users/lizote/)
 * (@lizote)
 * [1 month, 1 week ago](https://wordpress.org/support/topic/scheduled-scan-causes-500-error/)
 * We started having a weird issue where every night between 12:30am-12:40am CST
   our website would start throwing a 500 error for anywhere from 10-15min before
   going back online again. I assume this is related to Wordfence scanning our website.
   We are using the free version of Wordfence, so we can’t schedule a time for our
   scans, but the consistent timing of this outage has me thinking it’s some kind
   of scheduled process happening.
 * I’ve tried using low resource scanning just in case it was somehow overloading
   things, but that actually caused the site to go down and not go back up at all.
 * The only way to bring the site back online is for me to download the .htaccess
   file, delete the wordfence chunk, reupload it, refresh the site to ensure it’s
   back up, then paste the wordfence chunk back in and reupload it.
 * I’ve tried enabling live traffic for all just to see if there was anything in
   there that looked concerning, but there wasn’t.
 * We are currently stuck on an old version of php (7.4) and mysql (5.7), ubuntu
   18.04 with apache2 at the moment (working on getting that up to date), but any
   guidance for narrowing this down so I don’t have to do this every night would
   be appreciated.
 * The page I need help with: _[[log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fwordpress.org%2Fsupport%2Ftopic%2Fscheduled-scan-causes-500-error%2F%3Foutput_format%3Dmd&locale=en_US)
   to see the link]_

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

 *  Plugin Support [wfpeter](https://wordpress.org/support/users/wfpeter/)
 * (@wfpeter)
 * [1 month, 1 week ago](https://wordpress.org/support/topic/scheduled-scan-causes-500-error/#post-18838565)
 * Hi [@lizote](https://wordpress.org/support/users/lizote/), thanks for reaching
   out.
 * Wordfence’s scheduled scans are staggered by our servers to prevent too many 
   simultaneous requests at our end and their timing can also be different based
   on when the free plugin was installed. For example, my automatic scan took place
   at 8:22 this morning.
 * A large amount of database or file activity (including a Wordfence scan) and 
   a shortage of available resources _could_ cause an issue like the one you describe,
   but you can get the clearest idea of the cause from your PHP/server logs. At 
   the approximate timestamp of the 500 errors, there should be a more descriptive
   error/failure in your logs. Your server admin or host may be able to assist if
   those aren’t easily accessible from your filesystem or control panel. It’s also
   possible other scheduled tasks on the server like nightly backups could be the
   cause.
 * We’ll be happy to look into it further if it looks like Wordfence is causing 
   the issue described in the logs. Feel free to paste the line(s) from the log 
   to assist us.
 * Thanks,
   Peter.
 *  Thread Starter [Liz](https://wordpress.org/support/users/lizote/)
 * (@lizote)
 * [1 month, 1 week ago](https://wordpress.org/support/topic/scheduled-scan-causes-500-error/#post-18838641)
 * Thank you for your response. Interestingly, there is no error log for that timestamp,
   the next closest was from 12:54am, which was a core error for an ip address making
   an invalid uri request, but I did see several php fatal errors about memory usage
   exhaustion for wflogs/rules.php from much earlier in the day, which interestingly
   did not cause outages, so I’ve updated the appropriate files to increase memory
   usage to 256M. The mystery continues…
 *  Plugin Support [wfpeter](https://wordpress.org/support/users/wfpeter/)
 * (@wfpeter)
 * [1 month, 1 week ago](https://wordpress.org/support/topic/scheduled-scan-causes-500-error/#post-18838709)
 * Hi [@lizote](https://wordpress.org/support/users/lizote/), thanks for clarifying.
 * If there aren’t any errors logged, it points to the database being completely
   unreachable or locked. PHP/WordPress often can’t even begin executing enough 
   code to write to the log if it fails at the connection stage before any error
   handling kicks in. In the case of WordPress, if **wp-db.php** fails at the connection
   stage before `error_log()` is called anywhere then the web server will return
   a generic 500 response.
 * It may be possible to troubleshoot whether the database is performing a scheduled
   backup on itself at that time or what it was trying to do when it locked up or
   became unresponsive.
 * I hope that helps you out,
   Peter.

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

You must be [logged in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fwordpress.org%2Fsupport%2Ftopic%2Fscheduled-scan-causes-500-error%2F%3Foutput_format%3Dmd&locale=en_US)
to reply to this topic.

 * ![](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/)

## Tags

 * [500 error](https://wordpress.org/support/topic-tag/500-error/)
 * [htaccess](https://wordpress.org/support/topic-tag/htaccess/)

 * 3 replies
 * 2 participants
 * Last reply from: [wfpeter](https://wordpress.org/support/users/wfpeter/)
 * Last activity: [1 month, 1 week ago](https://wordpress.org/support/topic/scheduled-scan-causes-500-error/#post-18838709)
 * Status: resolved