比较来自世界各地的卖家的域名和 IT 服务价格

无法强制文件 PHP 工作“找不到文件”

我已经安装了 nginx 在我的 VPS, 在控制下运行 CentOS 6.3, 而且我无法制作任何文件 PHP.

这是我的文件 nginx.conf: -

    user  nginx;
worker_processes 2;

error_log /var/log/nginx/error.log warn;
pid /var/run/nginx.pid;


events {
worker_connections 1024;
}


http {
include /etc/nginx/mime.types;
default_type application/octet-stream;

log_format main '$remote_addr - $remote_user [$time_local] "$request" '
'$status $body_bytes_sent "$http_referer" '
'"$http_user_agent" "$http_x_forwarded_for"';

access_log /var/log/nginx/access.log main;

sendfile on;
#tcp_nopush on;

keepalive_timeout 65;

#gzip on;

include /etc/nginx/conf.d/*.conf;

fastcgi_buffers 8 16k;
fastcgi_buffer_size 32k;
server_names_hash_bucket_size 128;
server {
server_name example.org www.example.org;
listen 198.245.51.xxx;
root /var/www/forum;
index index.html index.htm index.php;
access_log /var/log/virtualmin/example.org_access_log;
error_log /var/log/virtualmin/example.org_error_log;
include fastcgi_params;
fastcgi_param GATEWAY_INTERFACE CGI/1.1;
fastcgi_param SERVER_SOFTWARE nginx;
fastcgi_param QUERY_STRING $query_string;
fastcgi_param REQUEST_METHOD $request_method;
fastcgi_param CONTENT_TYPE $content_type;
fastcgi_param CONTENT_LENGTH $content_length;
fastcgi_param SCRIPT_FILENAME /var/www/forum/$fastcgi_script_name;
fastcgi_param SCRIPT_NAME $fastcgi_script_name;
fastcgi_param REQUEST_URI $request_uri;
fastcgi_param DOCUMENT_URI $document_uri;
fastcgi_param DOCUMENT_ROOT /var/www/forum;
fastcgi_param SERVER_PROTOCOL $server_protocol;
fastcgi_param REMOTE_ADDR $remote_addr;
fastcgi_param REMOTE_PORT $remote_port;
fastcgi_param SERVER_ADDR $server_addr;
fastcgi_param SERVER_PORT $server_port;
fastcgi_param SERVER_NAME $server_name;
fastcgi_param HTTPS $https;
location ~ \.php$ {
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME /var/www/forum/$fastcgi_script_name;
fastcgi_param DOCUMENT_ROOT /var/www/forum;
include /etc/nginx/fastcgi_params;

}
ssl_certificate /home/example/ssl.cert;
ssl_certificate_key /home/example/ssl.key;
fastcgi_read_timeout 60;
autoindex on;
}
}

每当我想要打开时,我会收到以下消息 www.mydomain.com/index.php 或任何其他文件 php: -

https://i.imgur.com/eoy0ijT.png
先感谢您! 如果我能发布其他任何东西,请告诉我。
已邀请:

风见雨下

赞同来自:

更改了文件中的用户和组 domain.conf, 他开始再次工作了。 默认情况下,它已配置为用户: Apache 和小组: Apache.

我希望这将有助于未来同样的问题! 感谢大家答案 :)

要回复问题请先登录注册