【发布时间】:2017-10-20 07:56:26
【问题描述】:
我知道这是一个众所周知的问题。我几乎尝试了所有方法,但仍然无法修复。
意图是使用 php/wordpress 和已经存在的 nginx 作为 web 服务器创建一个博客。 Nginx 已经被用作 Rails 应用程序的 Web 服务器。
这是我的 nginx.conf 的样子
user centos;
worker_processes 1;
events {
worker_connections 1024;
}
http {
passenger_root /home/centos/.rvm/gems/ruby-2.1.4@tripshelf/gems/passenger-5.1.2;
passenger_ruby /home/centos/.rvm/gems/ruby-2.1.4@tripshelf/wrappers/ruby;
include mime.types;
default_type application/octet-stream;
sendfile on;
keepalive_timeout 65;
rails_env staging;
server {
listen 80;
server_name xx.xxx.xxx.xx;
location / {
root /data/staging-tiger/current/public/;
passenger_enabled on;
index index.html index.htm;
}
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root html;
}
location ~ \.php$ {
root /data/blog/;
index index.php index.html index.htm;
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}
}
}
我关注了数字海洋的tutorial,了解如何安装 LEMP 堆栈。
安装后,当我点击http://example.com/info.php 我得到
No input file specified
在进一步研究中,我尝试了:
为文档根目录 - /data/blog 设置正确的权限,并对 /、/data、/data/blog 和 /data/blog/info.php 具有适当的执行权限
php 位置块有自己的索引和根指令。
Nginx 以 centos 用户身份运行。这是
ps aux | grep nginx的输出
root 11510 0.0 0.1 53984 1320 ? Ss 07:06 0:00 nginx: master process /opt/nginx/sbin/nginx
centos 11513 0.0 0.2 54364 2612 ? S 07:06 0:00 nginx: worker process
centos 13471 0.0 0.0 103312 876 pts/1 S+ 07:42 0:00 grep nginx
-
用户和组在
/etc/php-fpm.d/www.conf文件中设置为centos。user = centosgroup = centos 文档根目录上的运行统计显示
文件:/data/blog/info.php
Size: 20 Blocks: 8 IO Block: 4096 regular file
Device: ca01h/51713d Inode: 525709 Links: 1
Access: (0755/-rwxr-xr-x) Uid: ( 500/ centos) Gid: ( 500/ centos)
Access: 2017-10-19 16:47:54.528000890 +0000
Modify: 2017-10-19 16:47:54.528000890 +0000
Change: 2017-10-20 06:18:28.000001084 +0000
我一直在思考这个问题,但到目前为止还没有突破。请帮忙。
提前致谢
【问题讨论】:
标签: php ruby-on-rails wordpress nginx digital-ocean