php - 子目录 nginx 中没有指定输入文件
问题描述
我正在尝试将index.php
文件html
夹中的文件设置为,将文件夹中localhost:5555
的第二个index.php
文件设置C:\\Users\\frisc\\GoogleDrive\\Other\\Personal Projects\\highlightForWord\\
为localhost:5555/highlighter
.
首先一切正常,但第二个不行,当我去localhost:5555/highlighter
打印时,No input file specified.
我还尝试将 phpMyAdmin 放在我html
的 as 中localhost:5555/phpMyAdmin
,即使没有location /phpMyAdmin
阻止,一切正常nginx.conf
你能帮我吗?
nginx.conf
worker_processes 1;
events {
worker_connections 1024;
}
http {
include mime.types;
default_type application/octet-stream;
sendfile on;
server {
listen 5555;
server_name localhost;
location / {
root html;
index index.php;
}
location /highlighter {
root "C:\\Users\\frisc\\GoogleDrive\\Other\\Personal Projects\\highlightForWord\\";
index index.php;
}
location ~ \.php$ {
fastcgi_pass 127.0.0.1:9123;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root html;
}
}
}
更新
我的错误是在位置块中添加 2 个根,如果您有同样的错误,请尝试像这样从位置块移动根
worker_processes 1;
events {
worker_connections 1024;
}
http {
include mime.types;
default_type application/octet-stream;
sendfile on;
keepalive_timeout 65;
server {
listen 5555;
server_name localhost;
root "D:\\Miscellaneous\\nginxSites";
location / {
index index.php;
}
location /highlighter {
index index.php;
}
location ~ \.php$ {
fastcgi_pass 127.0.0.1:9123;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root html;
}
}
}
解决方案
推荐阅读
- python - 超像素分割的问题(python中的opencv) - 分割掩码的轮廓中的孔
- python - PyCharm:访问同一个项目时,不能在两台不同的计算机上保持相同的解释器
- python - Heroku 远程错误:找不到满足要求 django-admin-black==0.0.1 的版本(来自 -r /tmp/build_e45a4b07/requirements.txt
- time-complexity - 时间复杂度 - 两个未排序的数组
- node.js - NextJS 将数据推送到变量实际上不起作用
- javascript - Vanilla JS,尝试访问数组中的对象
- entity-framework-core - 具有空引用的 EF Core Select 查询
- mysql - 错误 1045 (28000):Amazon Linux 2 上 mysql Ver 15.1 的用户 'root'@'localhost' 的访问被拒绝(使用密码:YES)
- android - 将产品搜索后端添加到 ML Kit 展示中
- python - Discord.py,on_raw_reaction_add add_roles 不起作用