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
]