Title: PHP errors on diff/file view for changed files
Last modified: May 25, 2018

---

# PHP errors on diff/file view for changed files

 *  Resolved [Juliette Reinders Folmer](https://wordpress.org/support/users/jrf/)
 * (@jrf)
 * [8 years ago](https://wordpress.org/support/topic/php-errors-on-diff-file-view-for-changed-files/)
 * L.S.,
 * First of all THANK YOU! I’ve been using WordFence for years and it makes me feel
   much better knowing it’s running on my sites.
 * Today, when I was going through the scan results, I tried to view a file diff
   for a “modified plugin file” and got the following PHP error and no diff shown(`
   original` showed, the `modified version` panel was blank):
 *     ```
       Backtrace from warning 'file_get_contents() [function.file-get-contents.php]: Filename cannot be empty' at /webroot/wp-content/plugins/wordfence/lib/wordfenceClass.php 4855:
   
           /webroot/wp-content/plugins/wordfence/lib/wordfenceClass.php 4855 calling file_get_contents()
           /webroot/wp-content/plugins/wordfence/lib/wordfenceClass.php 4549 calling wfFunc_diff()
           calling templateRedir()
           /webroot/wp-includes/class-wp-hook.php 286 calling call_user_func_array()
           /webroot/wp-includes/class-wp-hook.php 310 calling apply_filters()
           /webroot/wp-includes/plugin.php 453 calling do_action()
           /webroot/wp-includes/template-loader.php 12 calling do_action()
           /webroot/wp-blog-header.php 19 calling require_once()
           /webroot/index.php 17 calling require()
       ```
   
 * When I then just tried to view the modified file, I got an `We could not open
   the requested file for reading. The error was: Redefining already defined constructor
   for class SomeClassFromAnotherPlugin` error.
 * I fixed the class from the other plugin, uploaded the updated file and tried 
   again and now I get `We could not open the requested file for reading. The error
   was:` without any indication of the error.
 * While the `file_get_contents()` notice shows up in my PHP error log, the notice
   about the PHP 4 class constructor does not.
 * I haven’t looked at the related code in the WF plugin, but this gives me the 
   impression that you turn error reporting off for certain features, which makes
   debugging this so much harder.
 * Aside from the above issue with the diff viewing and the file display needing
   to be fixed, it would be great if you would not turn off `error_reporting`, but
   instead possibly just turn off `display_errors`. That way errors will still be
   logged if the administrator has configured them to be.
 * Hope this information helps & I look forward to the next version of WF!
 * Smile,
    Juliette
 * PHP 5.6.36
    WP 4.9.6 WF 7.1.6
    -  This topic was modified 8 years ago by [Juliette Reinders Folmer](https://wordpress.org/support/users/jrf/).
      Reason: Updated PHP version number to be more exact

Viewing 1 replies (of 1 total)

 *  [wfalaa](https://wordpress.org/support/users/wfalaa/)
 * (@wfalaa)
 * [7 years, 12 months ago](https://wordpress.org/support/topic/php-errors-on-diff-file-view-for-changed-files/#post-10365407)
 * Hi Juliette,
 * Thanks for all the details you shared on this thread. I’ve passed this one onto
   one of our QA team members and he took a look and it seems that we didn’t disable
   error reporting in this part. Could this be related to the site’s error_reporting
   value?
 * To continue investigating this issue, could you please mention some more details
   about this “SomeClassFromAnotherPlugin” and also which file was reported as being
   modified in the scan results? so we can try reproducing this issue.
 * Thanks.

Viewing 1 replies (of 1 total)

The topic ‘PHP errors on diff/file view for changed files’ 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/)

 * 1 reply
 * 2 participants
 * Last reply from: [wfalaa](https://wordpress.org/support/users/wfalaa/)
 * Last activity: [7 years, 12 months ago](https://wordpress.org/support/topic/php-errors-on-diff-file-view-for-changed-files/#post-10365407)
 * Status: resolved