Title: PHP Warning: filesize(): stat failed
Last modified: October 17, 2016

---

# PHP Warning: filesize(): stat failed

 *  Resolved [Matt](https://wordpress.org/support/users/syntax53/)
 * (@syntax53)
 * [9 years, 6 months ago](https://wordpress.org/support/topic/php-warning-filesize-stat-failed/)
 * I keep getting these repeated errors every day during scans.
 *     ```
       [16-Oct-2016 00:30:37 UTC] PHP Warning: filesize(): stat failed for D:\path\to\wp/wp-content/cache/page_enhanced/www.sitedomain.com/post_category1/name-of-post-1/_index.html.old in D:\path\to\wp\wp-content\plugins\wordfence\lib\wordfenceScanner.php on line 247
       [16-Oct-2016 00:31:07 UTC] PHP Warning: filesize(): stat failed for D:\path\to\wp/wp-content/cache/page_enhanced/www.sitedomain.com/post_category2/name-of-another-post/_index.html.old in D:\path\to\wp\wp-content\plugins\wordfence\lib\wordfenceScanner.php on line 247
       [16-Oct-2016 00:31:12 UTC] PHP Warning: filesize(): stat failed for D:\path\to\wp/wp-content/cache/page_enhanced/www.sitedomain.com/post_category3/name-of-a-different-post/_index.html.old in D:\path\to\wp\wp-content\plugins\wordfence\lib\wordfenceScanner.php on line 247
       [16-Oct-2016 00:31:16 UTC] PHP Warning: filesize(): stat failed for D:\path\to\wp/wp-content/cache/page_enhanced/www.sitedomain.com/path/to/a/page/_index.html.old in D:\path\to\wp\wp-content\plugins\wordfence\lib\wordfenceScanner.php on line 247
       ```
   
 * It’s always on the “.html.old” or the “.html” pages from W3 total cache. This
   just started happening a few weeks ago. I tried adding “*.old” and “*.html” to
   the exclude from scanning options but it doesn’t appear to be taking effect.

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

 *  [wfalaa](https://wordpress.org/support/users/wfalaa/)
 * (@wfalaa)
 * [9 years, 6 months ago](https://wordpress.org/support/topic/php-warning-filesize-stat-failed/#post-8330374)
 * Hi Matt,
    Can you please confirm if these files exist? maybe the cache is purged
   during the scan or something like that.
 * P.S. you can exclude cache folder from being scanned by entering `wp-content/
   cache/*` in
    (Wordfence > Options => [Exclude files from scan that match these wildcard patterns](https://docs.wordfence.com/en/Wordfence_options#Exclude_files_from_scan_that_match_these_wildcard_patterns.)).
 * Thanks.
 *  Thread Starter [Matt](https://wordpress.org/support/users/syntax53/)
 * (@syntax53)
 * [9 years, 6 months ago](https://wordpress.org/support/topic/php-warning-filesize-stat-failed/#post-8330466)
 * I imagine they are being deleted. I will try the “wp-content/cache/*” but why
   wouldn’t the “*.old” and “*.html” that I entered do the same thing?
 *  [wfalaa](https://wordpress.org/support/users/wfalaa/)
 * (@wfalaa)
 * [9 years, 6 months ago](https://wordpress.org/support/topic/php-warning-filesize-stat-failed/#post-8348504)
 * You are right, it might be a bug in the scan exclusions function, we opened an
   internal case for this issue (reference number: #3056) for further investigations.
 * Thanks.
 *  Thread Starter [Matt](https://wordpress.org/support/users/syntax53/)
 * (@syntax53)
 * [9 years, 6 months ago](https://wordpress.org/support/topic/php-warning-filesize-stat-failed/#post-8348566)
 * Ok, I will say that your fix worked. I am no longer getting the errors with the
   line you suggested.

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

The topic ‘PHP Warning: filesize(): stat failed’ 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/)

 * 4 replies
 * 2 participants
 * Last reply from: [Matt](https://wordpress.org/support/users/syntax53/)
 * Last activity: [9 years, 6 months ago](https://wordpress.org/support/topic/php-warning-filesize-stat-failed/#post-8348566)
 * Status: resolved