|
官方文档 http://www.php.net/manual/zh/ini.sections.php
* W, d9 J a: S' o) D5 d
5 ~1 w; q. M/ h, d! C, e4 H6 ^该功可以定义php站点 并限制php运行目录或者说路径 大概意思就是防止跨目录! t {" U* ]& w* t
" Q: }+ v! ^# `7 s1 |( _) v昨发布的Debian nginx php mysql一键包已应用 该功能
/ h+ b( E* L$ b3 o) `$ l% s" y5 I! [4 g5 P |# P. U% N& y
大概操作方法' I3 t `& t2 ?9 Z, y' Z
在php.ini内添加0 w4 ]: R' a, u1 w
[HOST=rootkong.com]
' d6 ]8 w+ w! {7 lopen_basedir ="/网站目录/" ; ]0 u, p9 X! f5 c+ ]7 J9 l
假设网站目录/home/rootkong.com 写法open_basedir ="/home/rootkong.com" 8 V- n9 K3 O, ^: | W
[HOST=www.rootkong.com]) o: }5 P' x1 o" B
open_basedir ="/网站目录/"
+ @$ {* c {7 r0 C' t" V假设网站目录/home/rootkong.com 写法open_basedir ="/home/rootkong.com"
2 A" ~3 N1 d6 A* O4 e如果想要该域名允许获取内存 cpu等信息 可以添加/proc/目录& b7 H7 c& _7 r! f+ c% g6 h c
例3 V+ ]4 H: |4 x0 ?$ a- Y5 m N4 Q
open_basedir ="/网站目录/:/proc/" * [! z6 s F' I( ^
允许phpmyadmin运行 添加/tmp/ 方法与以上例子相同8 I: @9 X& l7 M
没有特殊需求 越少越安全?7 @$ m' ?2 w! J' i& \& `, n
|
|