php安全设置

2016-07-28 10:25

//设置上传临时目录

upload_tmp_dir = "C:/Windows/Temp/"

//设置php权限目录 当前主机目录和临时文件夹目录

open_basedir = "./;C:/Windows/Temp/;"

//设置禁用危险函数

disable_functions = system, passthru, exec, shell_exec, popen, phpinfo, escapeshellarg, escapeshellcmd, proc_close, proc_open, dl


//在hosts文件设置

<VirtualHost *:80>
    DocumentRoot "D:\www\www.xxx.net"
      php_admin_value open_basedir "C:/Windows/Temp/;D:/www/www.xxx.net/"
    ServerName www.xxx.net
    ServerAlias m.xxx.net
  <Directory "D:\www\www.xxx.net">
      Options FollowSymLinks ExecCGI
      AllowOverride All
      Order allow,deny
      Allow from all
      Require all granted
  </Directory>
</VirtualHost>

^