PHP Safe Mode/open_basedir - lstat performance problem
Realpath cache is disabled if safe_mode or open_basedir are set. This dramatically reduce performance of PHP Engine and this behavior can bring a server to its knees. Especially because there is a lack of documentation!
Looking at source code main/main.c of PHP engine 5.2.13 you can see:
1292: /* Disable realpath cache if safe_mode or open_basedir are set */ if (PG(safe_mode) || (PG(open_basedir) && *PG(open_basedir))) { CWDG(realpath_cache_size_limit) = 0; } 1769: /* Disable realpath cache if safe_mode or open_basedir are set */ if (PG(safe_mode) || (PG(open_basedir) && *PG(open_basedir))) { CWDG(realpath_cache_size_limit) = 0; }
Please refer to: http://bugs.php.net/bug.php?id=52312