server {
? ? listen 80;
? ? server_name www.sdph.org.cn sdph.org.cn;
? ? index index.php index.html index.htm default.php default.htm default.html;
? ? root /www/wwwroot/yixuehui1/public;文章來源:http://www.zghlxwxcb.cn/news/detail-461780.html
? ? location ~* ^/(static|uploads|upload|images|cache|tmp|css|js)/.*.(php|php5)$ {
? ? ? ? deny all;?
? ? }
? ??
? ? location = /index.php {
? ? ? ? # 允許執(zhí)行 index.php 文件
? ? ? ? include fastcgi_params;
? ? ? ? fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
? ? ? ? fastcgi_pass ?unix:/tmp/php-cgi-73.sock;
? ? }
? ??
? ? location ^~ /runtime/ {
? ? ? ? # 允許執(zhí)行 runtime 目錄中的 PHP 文件
? ? ? ? include fastcgi_params;
? ? ? ? fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
? ? ? ? fastcgi_pass unix:/var/run/php/php7.3-fpm.sock; ?# 根據(jù)你的 PHP-FPM 配置調(diào)整
? ? }
? ??
? ? location ~ \.php$ {
? ? ? ? deny all;
? ? }
? ??
? ? # 其他配置項...
? ??
}
?文章來源地址http://www.zghlxwxcb.cn/news/detail-461780.html
到了這里,關于php限定能執(zhí)行的php目錄以及路徑的文章就介紹完了。如果您還想了解更多內(nèi)容,請在右上角搜索TOY模板網(wǎng)以前的文章或繼續(xù)瀏覽下面的相關文章,希望大家以后多多支持TOY模板網(wǎng)!