diff -Naur php-4.3.3-orig/TSRM/tsrm_virtual_cwd.c php-4.3.3/TSRM/tsrm_virtual_cwd.c --- php-4.3.3-orig/TSRM/tsrm_virtual_cwd.c 2003-07-28 20:35:34.000000000 +0200 +++ php-4.3.3/TSRM/tsrm_virtual_cwd.c 2003-09-25 17:08:27.000000000 +0200 @@ -307,10 +307,13 @@ * This can happen under solaris when a dir does not have read permissions * but *does* have execute permissions */ if (IS_ABSOLUTE_PATH(path, path_length) || (state->cwd_length < 1)) { - if (use_realpath && realpath(path, resolved_path)) { - path = resolved_path; - path_length = strlen(path); - } + if (use_realpath) { + char *rc = realpath(path, resolved_path); + if ( rc || errno == ENOENT ) { + path = resolved_path; + path_length = strlen(path); + } + } } else { /* Concat current directory with relative path and then run realpath() on it */ char *tmp; char *ptr;