• Resolved barkins

    (@barkins)


    Whenever I try to save a Page with WP Super Cache (Version 1.5.3) enabled I receive the following error message:

    Warning: realpath(): open_basedir restriction in effect. File(/) is not within the allowed path(s): (…..) in …..public_html/wp-content/plugins/wp-super-cache/wp-cache-phase1.php on line 677

    I contacted my Hosting company and they advised I reach out to plugin support.

    Thank you for any insight.

Viewing 11 replies - 1 through 11 (of 11 total)
  • Thread Starter barkins

    (@barkins)

    I went to the Advanced Tap and restored the plugin to the default configuration and the error went away. Not exactly sure which setting was causing the error, but all is good now.

    Same here. I get the same error message but restoring the default configuration doesn’t help. Please fix this error.

    I’m also getting this error…never had it before on older versions of Supercache and I’m using the exact same openbase settings I have always used.

    Hi Barkins,

    I made also an new topic off this issue! I hjave the same problem! But what you did is not helping. DO you have any other sollution?

    Thread Starter barkins

    (@barkins)

    @latortue Try clearing the cache within WP Super Cache’s settings. Also, go to Settings -> Permalinks and just click the Save button.

    @barkins already did this but get the same erros stil not have an fix for it! I hope you have something else…

    Thread Starter barkins

    (@barkins)

    @latortue Sorry I don’t. In my case, even though I was receiving the error message, the Page updates were still being saved.

    Open up wp-cache-phase1.php and go to line 677. It will be in the function wpsc_get_realpath( $directory ).

    Above the call to realpath() add this chunk of code:

        if ( $directory == '/' ) {
            return $directory;
        }

    Does that stop the warning happening?

    I added the chunk of code to wpsc_get_realpath() function and it stoped the warning happening.

    ps: Otherwise I had the same symptoms with the error as others had and restoring to default settings neither reinstalling the plugin did not work.

    Thanks @jansedlacek. A slightly modified version of this fix will be going into the next version.

    I did the same, in wp-cache-phase1.php, starting on line 677, I replaced:

    function wpsc_get_realpath( $directory ) {
    	$directory = realpath( $directory );
    	if ( substr( $directory, -1 ) == '/' || substr( $directory, -1 ) == '\\' ) {
    		$directory = substr( $directory, 0, -1 ); // remove trailing slash
    	}
    
    	return $directory;
    }

    With :

    function wpsc_get_realpath( $directory ) {
    	if ( $directory == '/' ) {
    		return $directory;
    	}
    	$directory = realpath( $directory );
    	if ( substr( $directory, -1 ) == '/' || substr( $directory, -1 ) == '\\' ) {
    		$directory = substr( $directory, 0, -1 ); // remove trailing slash
    	}
    
    	return $directory;
    }

    Worked well. Thank you.

    (I found wp-cache-phase1.php inside /wp-content/plugins/wp-super-cache)

    • This reply was modified 7 years, 3 months ago by cecilyuf.
Viewing 11 replies - 1 through 11 (of 11 total)
  • The topic ‘Warning: realpath(): open_basedir restriction in effect. File(/) is not within t’ is closed to new replies.