fastcgi_param PHP_VALUE "open_basedir=$document_root:/tmp/:/proc/";通常nginx的站点配置文件里用了include fastcgi.conf;,这样的,把这行加在fastcgi.conf里就OK了。
[HOST=www.server110.com] open_basedir=/home/www/www.server110.com:/tmp/:/proc/ [PATH=/home/www/www.server110.com] open_basedir=/home/www/www.server110.com:/tmp/:/proc/这种方式的设置需要重启php-fpm后生效。
open_basedir=/home/www/www.server110.com:/tmp/:/proc/这种方式不需要重启nginx或php-fpm服务。安全起见应当取消掉.user.ini文件的写权限。
disable_functions = pcntl_alarm, pcntl_fork, pcntl_waitpid, pcntl_wait, pcntl_wi
nginx+php使用open_basedir限制站点目录防止跨站
原文:http://www.cnblogs.com/q1104460935/p/7028881.html