• Hi all,

    After installing wordpress 2.7 i get this error:

    Warning: realpath() [function.realpath]: Unable to access /usr/home/web/snl126273/wp-content/uploads in /usr/home/web/snl122463/blog/wp-includes/functions.php on line 1767

    line 1767 is:

    function path_is_absolute( $path ) {
    	// this is definitive if true but fails if $path does not exist or contains a symbolic link
    	if ( realpath($path) == $path )
    		return true;

    need i set this setting to false?

Viewing 13 replies - 16 through 28 (of 28 total)
  • Seems that changing any php-files or setup new folders is the workaround, but after updating probably the problem will occur again.

    Who has the right solution. I agree, that it could be to do with the php-configuration of the WAMP.
    I have seen a lot of paths with user Pxxxx. Seems that they use the same provider.
    I have the same probleme with https://www.weber-led.de and my hoster is ready2host using CYCONF.

    On an other webspaceprovider with CONFIX it works with my other webadresse. https://www.pyramid-projects.com

    I guess it is the PHP-Configuration of the interpreter. But cannot influence it.

    Hope for solution soon.

    After a lot of trials, I got it.
    Just delete the “wp-content/uploads” and keep the field empty.
    Then it is using the default, that is just the same.

    That′s strange, isn′t it ?

    I also changed WordPress to a new server and tried all the steps above and it did not work. In my case it also encountered these strange path error:

    wp-admin/admin/admin.php in httpdocs/wp-includes/functions.php on line 1963

    In the end I found out it was a module (contact form 7), which resolved the whole mistake. Turned it off and works now fine.

    Thanks, tompress1, worked perfectly for me.

    tompress – you saved my sanity. Is this a bug, or what?

    Mad Max

    (@mad_max)

    tompress1 gets it right! But there is still a problem with PHP realpath() function (under some circustances) throwing out PHP warnings.

    To resolve issue about php warning with realpath(), you have to test if a path exists before apply realpath() to it. So, for example, edit yourWPblogpath/wp-admin/includes/post.php, at line 1263 and substitute this

    if ( function_exists('realpath') )
      $path = trailingslashit( realpath($path) );

    with

    if ( function_exists('realpath') )
      if (file_exists($path)) {
        $path = trailingslashit( realpath($path) );
      } else {
        $path = "";
      }

    Obviously, this patch has to be applied on all others core files using realpath() function this way, i.e.
    wp-admin/includes/class-ftp.php
    wp-admin/load-styles.php
    wp-admin/load-scripts.php

    This “bug” is due to the inclusion of the Hardened-PHP Project’s Suhosin Patch in many distributions of PHP (version > 5.2.3) by default (Ubuntu Hardy 8.04 for example).
    This patch replaces PHPs realpath function with the BSD implementation, which ignores the last path component.

    The workaround is to use the file_exists function to verify that the file exists before using realpath to get its real path string.

    Joomla! soffers of the same bug also and the patch was not included
    yet, even in the actual 1.5.15 version.
    Hope WordPress developer take care of this quickly.

    [Explanation taken from
    https://www.php.net/manual/en/function.realpath.php#82770
    https://www.hardened-php.net/suhosin/a_feature_list:realpath.html
    ]

    makanimike

    (@makanimike)

    I also changed WordPress to a new server and tried all the steps above and it did not work. In my case it also encountered these strange path error:

    wp-admin/admin/admin.php in httpdocs/wp-includes/functions.php on line 1963

    In the end I found out it was a module (contact form 7), which resolved the whole mistake. Turned it off and works now fine.

    I have the error in wp-includes/functions.php line 1963, just like you.

    can you (or someone) explain what contact form 7 means and describe the fix a little more? thanks

    (so annoying. it was working fine until an hour ago)

    alternatively, with what do I replpace this code?

    if ( realpath($path) == $path )<br />
    		return true;

    brenb

    (@brenb)

    I’m getting this error too, but if I deactivate Contact Form 7 it works fine….. but I don’t want to activate Contact Form 7 because it’s the most useful plugin ever!!!

    Any suggestions? If I reactivate the error gets thrown up again… and (wierdly) I can only deactivate by using the radio button and then using the bul activate…. just hitting the deactivate link on CF7 throws up an error….. very odd….. and very annoying!

    The problem appeared when I switched my hosting server… though other sites on the same server that I’ve moved (which use CF7 as well) haven’t had the same problem.

    brenb

    (@brenb)

    Bit of an update…. I uploaded the previous version of CF7 and it doesn’t throw up the error anymore….

    Nope! Still got the problem it appears…. I hadn’t looked in the media section – I GET the same error everyone else:

    Warning: realpath() [function.realpath]: Unable to access /var/www/vhosts/*SITE*/httpdocs/wp-admin/wp-content/uploads in /var/www/vhosts/*SITE*/httpdocs/wp-includes/functions.php on line 1963

    What can I do to fix this?? It appears to be on all my sites… and I’m no php guru!!

    Any suggestions please?

    What an idiot – I didn’t properly read tompress1’s fix!!!

    THANKYOU!!!!

    This may help some people – I had an error coming up in reference to realpath in the wp-includes/functions.php file….. so, on line 1963 I changed:

    if ( realpath($path) == $path )
    		return true;

    to:

    if ( file_exists($path) == $path )
    		return true;

    Works fine now – thanks to Mad_Max

    Gary

    (@garydouglas)

    Hi Guys

    Ive had this problem after recently moving servers, replacing all the files didn’t do anything.

    The way i resolved this was to look in the DB using phpmyadmin and change the upload path to include the full server path as well

    Change

    /wp-content/uploads

    To

    /var/www/vhosts/************.co.uk/httpdocs/wp-content/uploads

    Obviously the server path will be different for everyone. but htis worked for me.

    Regards
    Gary

Viewing 13 replies - 16 through 28 (of 28 total)
  • The topic ‘Warning: realpath() [function.realpath]: Unable to access’ is closed to new replies.