
22nd October 2012, 14:02
|
|
Member
|
|
Join Date: May 2011
Location: Cape Town, South Africa
Posts: 49
Thanks: 6
Thanked 2 Times in 2 Posts
|
|
Is it safe to disable open_basedir? (Fast-CGI + suEXEC + Suhosin)
Hi,
I need to disable PHP's open_basedir for performance reasons – is it relatively safe to do this on a dedicated server with Fast-CGI, suEXEC, and Suhosin?
What are the considerations?
Thanks.
Last edited by darkangel; 22nd October 2012 at 14:15.
|

23rd October 2012, 16:11
|
|
Super Moderator
|
|
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 41,685
Thanks: 1,899
Thanked 2,599 Times in 2,448 Posts
|
|
No, this is not safe because you can read all kinds of other files outside the website's document root from a PHP script.
|

23rd October 2012, 16:53
|
|
Member
|
|
Join Date: May 2011
Location: Cape Town, South Africa
Posts: 49
Thanks: 6
Thanked 2 Times in 2 Posts
|
|
Only files readable by that particular web user (e.g. "web1"), right? Things like log files?
And this is only an issue if you have vulnerable code?
I needed to disable it because of this bug with PHP.
|

23rd October 2012, 17:22
|
|
Super Moderator
|
|
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 32,066
Thanks: 697
Thanked 4,248 Times in 3,260 Posts
|
|
Quote:
|
Only files readable by that particular web user (e.g. "web1"), right? Things like log files?
|
All files that are readable by the web[id] user, client[id] group or that are world readable like some config files in /etc.
|

23rd October 2012, 21:53
|
|
Senior Member
|
|
Join Date: Nov 2010
Posts: 335
Thanks: 24
Thanked 43 Times in 39 Posts
|
|
Out of curiosity (and I'm not necessarily saying you're wrong), what has lead you to conclude that PHP's open_basedir directive is hindering performance significantly?
|

24th October 2012, 09:44
|
|
Member
|
|
Join Date: May 2011
Location: Cape Town, South Africa
Posts: 49
Thanks: 6
Thanked 2 Times in 2 Posts
|
|
Did you read the bug report that I linked to? It prevents the use of the realpath cache.
|

24th October 2012, 15:49
|
|
Senior Member
|
|
Join Date: Nov 2010
Posts: 335
Thanks: 24
Thanked 43 Times in 39 Posts
|
|
No, sorry, I had missed that hyperlink. After all, it is a bit small.
I ask only so that I, too, may be informed if there is a genuine performance problem with when safe_mode or open_basedir is used. I read every post in the bug report and it seems that there is indeed an issue at a significant level of scale.
Out of curiosity alone, are you actually hosting a sufficient number of sites to feel that performance hit? If so, how many sites?
|

24th October 2012, 18:35
|
|
Member
|
|
Join Date: May 2011
Location: Cape Town, South Africa
Posts: 49
Thanks: 6
Thanked 2 Times in 2 Posts
|
|
I don't think it has anything to do with how many sites you're hosting (we only have 2 main websites). It would affect any PHP website, but mostly larger sites with lots of file includes (which we have).
|

24th October 2012, 19:22
|
|
Senior Member
|
|
Join Date: Nov 2010
Posts: 335
Thanks: 24
Thanked 43 Times in 39 Posts
|
|
Right; that makes sense.
Have you run benchmarks to assess the performance impact of using safe_mode or open_basedir in your particular situation?
I'm curious just how much of an impact the inability to use the realpath cache might have. A percentage would be ideal, e.g., "Disabling safe_mode and open_basedir yields a 25% performance improvement."
Ultimately, I'm wondering at what point a server administrator should consider disabling safe_mode and open_basedir in favor of performance -- i.e., at how many require() and/or include() statements.
Obviously, this determination must be made on a case-by-case basis, and it will depend largely on how many and what type of sites occupy the server, but some basic guidelines would be most helpful.
If you're willing to share your findings, thank you in advance.
|

24th October 2012, 19:39
|
|
Member
|
|
Join Date: May 2011
Location: Cape Town, South Africa
Posts: 49
Thanks: 6
Thanked 2 Times in 2 Posts
|
|
|
| Thread Tools |
|
|
| Display Modes |
Linear Mode
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
All times are GMT +2. The time now is 03:44.
|
Recent comments
1 day 5 hours ago
1 day 8 hours ago
1 day 19 hours ago
1 day 22 hours ago
2 days 2 hours ago
2 days 9 hours ago
2 days 18 hours ago
2 days 20 hours ago
3 days 4 hours ago
3 days 5 hours ago