几个小时以来,我一直在尝试搜索这个问题,但似乎没有任何解决方案适用于我的情况。
出于测试目的,我已经在 raspbian 上的 nginx 服务器中安装了 joomla。 该目录位于/var/www/joomla。
如果我将根目录从/etc/nginx/sites-available 更改为/var/www/joomla,该站点将正常工作,但如果我希望从 http://www.example.com/joomla 访问我的 joomla 站点, 它不会起作用。 我可以访问 joomla 主页,但如果我单击主页上的某个链接(例如,我有一个地址为 http://www.example.com/joomla/index.php/contact 的联系表),我会收到“没有指定输入文件的错误”。
这是我在/etc/nginx/sites-available/site 中的配置:
server {
listen 80;
root /var/www;
index index.php index.html index.htm;
location / {
try_files $uri $uri/ /index.php?q=$request_uri;
}
location ~ \.php$ {
fastcgi_pass unix:/var/run/php5-fpm.sock;
fastcgi_index index.php;
include fastcgi_params;
}
}
我读到这个错误可能与 fastcgi_param SCRIPT_FILENAME 有关,但我不知道我应该编辑什么以及从哪里编辑。
谢谢!
最佳答案
是的!我让它工作了。感谢告诉解决方案的 Joe Niland。
我实际上试过一次,但我可能错过了 joomla/index.php 之前的“/”....
工作的/etc/nginx/sites-available/site 配置现在是:
server {
listen 80;
root /var/www;
index index.php index.html index.htm;
location / {
try_files $uri $uri/ /joomla/index.php?q=$request_uri;
}
location ~ \.php$ {
fastcgi_pass unix:/var/run/php5-fpm.sock;
fastcgi_index index.php;
include fastcgi_params;
}
}
关于php - nginx 错误 : "No input file specified" when website in subdirectory,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27246326/