1、開啟phpinfo,修改php.ini文件喻旷,文件路徑:/usr/local/php/etc/php.ini,CGI修復(fù)其路徑以符合規(guī)范:
#cgi.fix_pathinfo=0 修改為下行
cgi.fix_pathinfo=1
2牢屋、去除上傳文件目錄限制且预,修改fastcgi.conf文件槽袄,文件路徑:/usr/local/nginx/conf/fastcgi.conf
fastcgi_param PHP_ADMIN_VALUE "open_basedir=$document_root/:/tmp/:/proc/"; 修改為下行,即注釋掉PHP_ADMIN_VALUE行配置
#fastcgi_param PHP_ADMIN_VALUE "open_basedir=$document_root/:/tmp/:/proc/";
3锋谐、虛擬主機中使用帶pathinfo的配置文件遍尺,/usr/local/nginx/conf/nginx
server{
#include enable-php.conf 修改為下行
include enable-php-pathinfo.conf
...
}
4、網(wǎng)站/系統(tǒng)目錄文件夾權(quán)限設(shè)置為755
chmod 755 網(wǎng)站根目錄 -R