php safe mode on,php高级之php.ini safe_mode

php.ini中的safe_mode如下:

; Safe Mode

;

safe_mode = Off

; By default, Safe Mode does a UID compare check when

; opening files. If you want to relax this to a GID compare,

; then turn on safe_mode_gid.

safe_mode_gid = Off

; When safe_mode is on, UID/GID checks are bypassed when

; including files from this directory and its subdirectories.

; (directory must also be in include_path or full path must

; be used when including)

safe_mode_include_dir =

; When safe_mode is on, only executables located in the safe_mode_exec_dir

; will be allowed to be executed via the exec family of functions.

safe_mode_exec_dir =

; Setting certain environment variables may be a potential security breach.

; This directive contains a comma-delimited list of prefixes. In Safe Mode,

; the user may only alter environment variables whose names begin with the

; prefixes supplied here. By default, users will only be able to set

; environment variables that begin with PHP_ (e.g. PHP_FOO=BAR).

;

; Note: If this directive is empty, PHP will let the user modify ANY

; environment variable!

safe_mode_allowed_env_vars = PHP_

; This directive contains a comma-delimited list of environment variables that

; the end user won't be able to change using putenv(). These variables will be

; protected even if safe_mode_allowed_env_vars is set to allow to change them.

safe_mode_protected_env_vars = LD_LIBRARY_PATH

safe_mode 是一种安全模式,他提供了一个基本安全的共享环境,

在一个有多个用户账户存在的php开发的web服务器上。当安全模式打开的时候,一些函数将被完全的禁止,而另一些函数的功能将会受到限制,如:chdir,move_uploaded_file,chgrp,parse_ini_file,chown,rmdir,copy,rename,fopen,require,mkdir,unlink等。

注意,在php5.3以上版本,safe_mode被弃用,在php5.4以上版本,则将此特性完全去除了。

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值