Forums

Warning: realpath() [function.realpath]: Unable to access (29 posts)

  1. blaatje123456
    Member
    Posted 3 years ago #

    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?

  2. MichaelH
    Volunteer
    Posted 3 years ago #

    Make sure you have proper setting in Settings->Miscellaneous for the Uploads folder and make sure that folder has the proper file permissions (e.g. 777)

  3. blaatje123456
    Member
    Posted 3 years ago #

    thanks, i have looked into this issue but i saw something strange:

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

    but the path is no wp-admin. it's the path without the wp-admin part. How to fix this?

  4. MichaelH
    Volunteer
    Posted 3 years ago #

    I'm guessing you got all your WordPress files uploaded properly because you were able to install WordPress. You could have file permission problems so make sure you read Changing File Permissions in regards to wp-content, wp-content/uploads folders.

    In my wp_options table I have the following values so you might want to make sure via phpMyAdmin that you have something similar that matches your paths:

    fileupload_realpath
    /home/mjbj/public_html/wordpress/wp-content

    fileupload_url
    /http://mjbj.com/wordpress/wp-content

    upload_path
    wp-content/uploads

  5. blaatje123456
    Member
    Posted 3 years ago #

    have checked and check again, but i'm stuck.

    Unable to access /usr/home/web/snl126273/blog/wp-admin/wp-content/uploads/ in /usr/home/web/snl126273/blog/wp-includes/functions.php on line 1767

    line 1767:

    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;
    
    	if ( strlen($path) == 0 || $path{0} == '.' )
    		return false;
    
    	// windows allows absolute paths like this
    	if ( preg_match('#^[a-zA-Z]:\\\\#', $path) )
    		return true;
    
    	// a path starting with / or \ is absolute; anything else is relative
    	return (bool) preg_match('#^[/\\\\]#', $path);
    }
  6. blaatje123456
    Member
    Posted 3 years ago #

    Warning: realpath() [function.realpath]: Unable to access /usr/home/web/snl126273/blog/wp-admin/wp-content/uploads/ in /usr/home/web/snl126273/blog/wp-includes/functions.php on line 1767
    
    Warning: realpath() [function.realpath]: Unable to access /usr/home/web/snl126273/blog/wp-admin/wp-content/uploads/ in /usr/home/web/snl126273/blog/wp-includes/functions.php on line 1767
    
    Warning: Cannot modify header information - headers already sent by (output started at /usr/home/web/snl126273/blog/wp-includes/functions.php:1767) in /usr/home/web/snl126273/blog/wp-includes/pluggable.php on line 850

    After removing a file
    it says the "wp-admin/wp-content/uploads" folder is not there. That's right, because it doesn't exist. It must be "wp-content/uploads"
    where to fix this?
    into the media-> Miscellaneous Settings the path is "wp-content/uploads/"

  7. MichaelH
    Volunteer
    Posted 3 years ago #

    Use FTP client to create wp-content/uploads folder and change permissions accordingly.

  8. blaatje123456
    Member
    Posted 3 years ago #

    already done, to chmod 777

    see this screenshot:

    http://img296.imageshack.us/img296/8376/screenzc0.jpg

  9. Otto
    Tech Ninja
    Posted 3 years ago #

    /usr/home/web/snl126273/blog/wp-admin/blog/wp-content/uploads

    That path doesn't really make any sense. What is the value on the top two fields on your Settings->Miscellaneous config screen?

    The first field should just be "wp-content/uploads". Not "wp-admin/blog/wp-content/uploads".

  10. blaatje123456
    Member
    Posted 3 years ago #

    i know, my config screen is this:

    http://img401.imageshack.us/img401/2388/35846330rh3.jpg

    i have fixed now:
    i have created 3 new folders into the wp-admin folder.
    my structure is now:

    /blog/wp-admin/blog/wp-content/uploads/
    (not into the miscellaneous screen) but @ my ftp
    very strange and weird situation

  11. MichaelH
    Volunteer
    Posted 3 years ago #

    I don't know that you have it correct.

    In fact you might be better off starting over by deleting all WordPress files and folders, except wp-config.php.

    Then drop the WordPress tables using phpMyAdmin.

    Then review and follow the instructions in Installing WordPress and Uploading WordPress to a remote host.

  12. blaatje123456
    Member
    Posted 3 years ago #

    Well, it's working now.
    I have already deleted all the files (except the wp-content folder)but doesn't help.

    With this solution of creating some folders into the admin folder it works now.

  13. MichaelH
    Volunteer
    Posted 3 years ago #

    With a directory structure like /blog/wp-admin/blog/wp-content/uploads/ I would expect you to have problems in the future.

    Please read WordPress Backups and in particular pay attention to how to backup your database because you will likely have problems in the future so it will be important to have a database backup.

  14. ZeroChaos
    Member
    Posted 3 years ago #

    I also had the same problem after installing WordPress 2.7. Solved the problem as follows:
    1. Create a folders in 'wp-admin' 'wp-content/uploads'
    2. Open wp-includes/functions.php and replace

    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;

    with

    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 )
    		$path == realpath($path);
    	else
    		return true;

    That's all! All files will now be filled in wp-content/uploads. Enjoy!

  15. pronetas
    Member
    Posted 2 years ago #

    no didnt help

    Warning: realpath() [function.realpath]: Unable to access /var/www/vhosts/feeder.lt/subdomains/market/httpdocs/wp-admin/wp-content/uploads in /var/www/vhosts/feeder.lt/subdomains/market/httpdocs/wp-includes/functions.php on line 1767

    Warning: realpath() [function.realpath]: Unable to access /var/www/vhosts/feeder.lt/subdomains/market/httpdocs/wp-admin/wp-content/uploads in /var/www/vhosts/feeder.lt/subdomains/market/httpdocs/wp-includes/functions.php on line 1768

  16. jlubeck
    Member
    Posted 2 years ago #

    Were you able to solve this problem? I'm have the same issue. Everything is working, but those warning are very annoying.

    I'm having the same blog installed in two different hostings, one has the warnings and the other hasn't. So I'm guessing it has something to do with the PHP configuration? But I have no clue what to look for...

    Cheers!

  17. tompress1
    Member
    Posted 2 years ago #

    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 http://www.weber-led.de and my hoster is ready2host using CYCONF.

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

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

    Hope for solution soon.

  18. tompress1
    Member
    Posted 2 years ago #

    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 ?

  19. crisscrossed
    Member
    Posted 2 years ago #

    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.

  20. pwndrian
    Member
    Posted 2 years ago #

    Thanks, tompress1, worked perfectly for me.

  21. tillisonm
    Member
    Posted 2 years ago #

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

  22. mad_max
    Member
    Posted 2 years ago #

    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
    http://www.php.net/manual/en/function.realpath.php#82770
    http://www.hardened-php.net/suhosin/a_feature_list:realpath.html
    ]

  23. makanimike
    Member
    Posted 2 years ago #

    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;
  24. brenb
    Member
    Posted 2 years ago #

    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.

  25. brenb
    Member
    Posted 2 years ago #

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

  26. brenb
    Member
    Posted 2 years ago #

    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?

  27. brenb
    Member
    Posted 2 years ago #

    What an idiot - I didn't properly read tompress1's fix!!!

    THANKYOU!!!!

  28. brenb
    Member
    Posted 2 years ago #

    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

  29. GaryDouglas
    Member
    Posted 2 years ago #

    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

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.