|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #46965 realpath_cache is disabled when safe_mode or open_basedir is enabled
Submitted: 2008-12-29 21:16 UTC Modified: 2009-01-01 19:42 UTC
Avg. Score:5.0 ± 0.0
Reproduced:3 of 3 (100.0%)
Same Version:2 (66.7%)
Same OS:1 (33.3%)
From: phpbugs at bsdchicks dot com Assigned:
Status: Wont fix Package: Safe Mode/open_basedir
PHP Version: 5.2.8 OS: *
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
Block user comment
Status: Assign to:
Bug Type:
From: phpbugs at bsdchicks dot com
New email:
PHP Version: OS:


 [2008-12-29 21:16 UTC] phpbugs at bsdchicks dot com
Having a lot of performance issues on FreeBSD caused an investigation into realpath_cache. It turns out the cache is disabled when safe mode or open basedir are enabled. However, in a client's configuration, with FastCGI and SuExec, realpath_cache poses no security threat. With this cache, performance is greatly improved.

It should be optional to override the decision to disable the cache.

Reproduce code:
/* 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;

Expected result:

Actual result:


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2009-01-01 19:42 UTC]
Real path cache would make some checks unreliable. If you are using 
SuExec or FastCGI you don't need open_basedir, you can use file system 
permissions to implement access limitations much faster & more reliably.
PHP Copyright © 2001-2022 The PHP Group
All rights reserved.
Last updated: Sat Oct 01 16:05:52 2022 UTC