• Resolved dbase66

    (@dbase66)


    Warnung fopen(/homepages/20/d34869179/htdocs/AM/wp-content/cache/seraphinite-accelerator/s/m/up): Failed to open stream: No such file or directory
    wp-content/plugins/seraphinite-accelerator-ext/Cmn/Gen.php:793
    1 Plugin: seraphinite-accelerator-ext

    Warnung fopen(/homepages/20/d34869179/htdocs/AM/wp-content/cache/seraphinite-accelerator/s/m/schu): Failed to open stream: Is a directory
    wp-content/plugins/seraphinite-accelerator-ext/Cmn/Gen.php:793
    1 Plugin: seraphinite-accelerator-ext

    Warnung fopen(/homepages/20/d34869179/htdocs/AM/wp-content/cache/seraphinite-accelerator/s/m/cln): Failed to open stream: No such file or directory
    wp-content/plugins/seraphinite-accelerator-ext/Cmn/Gen.php:793

Viewing 8 replies - 16 through 23 (of 23 total)
  • Plugin Author Seraphinite Solutions

    (@seraphinitesoft)

    Pls, test this:

    static private function _FileOpen( $filename, $mode, $use_include_path = false )
    {
        $nErrRepprev = @error_reporting( 0 );
        $h = @fopen( $filename, $mode, $use_include_path );
        @error_reporting( $nErrRepprev );
        return( $h );
    }
    Thread Starter dbase66

    (@dbase66)

    no effect

    try/catch could be better, to catch error-states

    Plugin Author Seraphinite Solutions

    (@seraphinitesoft)

    Pls, try this (but try/catch works only with non system exceptions):

    static private function _FileOpen( $filename, $mode, $use_include_path = false )
    {
        $nErrRepprev = @error_reporting( 0 );
        try
        {
            $h = @fopen( $filename, $mode, $use_include_path );
        }
        catch( \Exception $e )
        {
        }
        @error_reporting( $nErrRepprev );
        return( $h );
    }
    Thread Starter dbase66

    (@dbase66)

    ok, nothing happens, the same status

    Plugin Author Seraphinite Solutions

    (@seraphinitesoft)

    Looks like server PHP setting have forced displaying of warnings.

    Thread Starter dbase66

    (@dbase66)

    i do this:

    static private function _FileOpen( $filename, $mode, $use_include_path = false )
    {
    $nErrRepprev = @error_reporting( E_ERROR | E_PARSE | E_CORE_ERROR | E_COMPILE_ERROR | E_USER_ERROR | E_RECOVERABLE_ERROR );
    if( @file_exists( $filename ) ) {
    if ( !$h = @fopen( $filename, $mode, $use_include_path )) {
    $h = false;
    }
    } else {
    $h = false;
    }

    @error_reporting( $nErrRepprev );
    return( $h );
    }

    and now, only “schu” is the directory, wich gives error, because is exists!

    But with _fileOpen, you do not open file, you will open directory? there is no filename, only directoryname?

    Plugin Author Seraphinite Solutions

    (@seraphinitesoft)

    Yes, it works. We dont want to add this checking due to minimize code while operating with files.

    “schu” should be file.

    Plugin Author Seraphinite Solutions

    (@seraphinitesoft)

    Furthermore, in such approach there is small probability that file is deleted after checking that it exists. So, this will produce unneeded warning again.

Viewing 8 replies - 16 through 23 (of 23 total)
  • The topic ‘Failed to open stream: No such file or directory’ is closed to new replies.