• deeholzman

    (@deeholzman)


    Hi, we have an error occurring intermittently on our site with WP Super Cache Installed and using PHP to serve cached files.

    Here are our settings:

    • Compress pages so they’re served more quickly to visitors.
    • 304 Not Modified browser caching.
    • Don’t cache pages for known users.
    • Don’t cache pages with GET parameters.
    • Cache rebuild.

    Here is the error that we are receiving:

    File: /var/www/vhosts/66/238781/webspace/httpdocs/ourwebsite.com/wp-content/plugins/wp-super-cache/wp-cache-phase2.php

    Line: 324

    Message: unlink(/var/www/vhosts/66/238781/webspace/httpdocs/ourwebsite.com/wp-content/cache/supercache/portofhoodriver.com/index.html.php): No such file or directory

    Any idea what could be causing this error?

    https://wordpress.org/plugins/wp-super-cache/

Viewing 1 replies (of 1 total)
  • Thread Starter deeholzman

    (@deeholzman)

    In case anyone else is researching this, I found the cause of the error – in the page /wp-super-cache/wp-cache-phase2.php on line 326 there is this command:

    @unlink( $cache_file );

    This can create an error because there isn’t always a $cache_file to delete. The ‘@’ before ‘unlink’ is meant to suppress any error messages, in case the ‘$cache_file’ file does not exist.

    My custom error reporting function (set with ‘set_error_handler()’) was still reporting this error, as ALL error reporting set up like this will. The @unlink command will still generate an error, while setting error_reporting() = 0. So to solve the problem and eliminate error notifications, if you’re using a custom error handler, just make sure that error_reporting wasn’t set to 0:

    function customErrorHandler ($level,$message,$file,$line,$context){
    if (error_reporting() !== 0) {
    //handle the error
    {
    }

    Perhaps a better way to handle this in the plugin is before calling unlink($cache_file), make sure the file exists:

    if ( file_exists($cache_file) ) {
    @unlink( $cache_file );
    }
Viewing 1 replies (of 1 total)
  • The topic ‘Odd PHP error message occuring on wp-super-cache plugin page’ is closed to new replies.