【问题标题】:No Input File Specified for Wordpress on Local Virtualbox Centos 7 VM running NGINX没有为运行 NGINX 的本地 Virtualbox Centos 7 VM 上的 Wordpress 指定输入文件
【发布时间】:2017-11-13 03:39:20
【问题描述】:

我正在尝试在 Centos 7 上的本地 Wordpress 网站上使用漂亮的永久链接

但是当我尝试去一个帖子时,我得到No file specified

我确实在共享文件夹中有这个网站,但即使我把它放在我的 VM 上的常规文件夹中,它也不起作用。

我找遍了所有答案,但没有找到。

这是我的nginx configuration file

server {
listen       80;
server_name  localhost;

# note that these lines are originally from the "location /" block
root   /var/www/html;
index index.php index.html index.htm;

location / {
    try_files $uri $uri/ /index.php?$args;
}
error_page 404 /404.html;
error_page 500 502 503 504 /50x.html;
location = /50x.html {
    root /usr/share/nginx/html;
}

location ~ \.php$ {
    fastcgi_pass unix:/var/run/php-fpm/php-fpm.sock;
    fastcgi_index index.php;
    fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}
}

【问题讨论】:

  • 该错误暗示/var/www/html/index.php 不存在。您的 WordPress 网站的 URL 是什么?是否缺少子目录?
  • 该死!!我 Duh,把 index.php 工作了!!!

标签: php wordpress nginx virtualbox centos7


【解决方案1】:

我只需将index.php 移动到我的网络根目录。

【讨论】:

  • 在 WordPress 安装中移动 index.php 应该是不必要的。您的 try_files 语句应该指向 WordPress 顶级 index.php 文件的实际 URI,例如try_files $uri $uri/ /blog/index.php;
猜你喜欢
  • 1970-01-01
  • 2016-05-09
  • 1970-01-01
  • 2018-02-12
  • 2015-12-11
  • 1970-01-01
  • 2020-03-09
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多