VPS侦探论坛

 找回密码
 注册
查看: 4553|回复: 1

新增加的虚拟主机无法执行PHP

[复制链接]
发表于 2013-12-13 03:42:34 | 显示全部楼层 |阅读模式

新增加的虚拟主机无法执行PHP

出现
Access denied.

求教.

以下是配置代码:
  1. user  www www;worker_processes 1;error_log  /home/wwwlogs/nginx_error.log  crit;pid        /usr/local/nginx/logs/nginx.pid;#Specifies the value for maximum file descriptors that can be opened by this process.
  2. worker_rlimit_nofile 51200;events
  3. {
  4.   use epoll;
  5.   worker_connections 51200;
  6. }http
  7. {
  8.   include       mime.types;
  9.   default_type  application/octet-stream;  server_names_hash_bucket_size 128;
  10.   client_header_buffer_size 32k;
  11.   large_client_header_buffers 4 32k;
  12.   client_max_body_size 50m;  sendfile on;
  13.   tcp_nopush     on;  keepalive_timeout 60;  tcp_nodelay on;  fastcgi_connect_timeout 300;
  14.   fastcgi_send_timeout 300;
  15.   fastcgi_read_timeout 300;
  16.   fastcgi_buffer_size 64k;
  17.   fastcgi_buffers 4 64k;
  18.   fastcgi_busy_buffers_size 128k;
  19.   fastcgi_temp_file_write_size 256k;  gzip on;
  20.   gzip_min_length  1k;
  21.   gzip_buffers     4 16k;
  22.   gzip_http_version 1.0;
  23.   gzip_comp_level 2;
  24.   gzip_types       text/plain application/x-javascript text/css application/xml;
  25.   gzip_vary on;
  26.   gzip_proxied        expired no-cache no-store private auth;
  27.   gzip_disable        "MSIE [1-6]\.";  #limit_zone  crawler  $binary_remote_addr  10m;  server_tokens off;
  28.   #log format
  29.   log_format  access  '$remote_addr - $remote_user [$time_local] "$request" ' '$status $body_bytes_sent "$http_referer" ' '"$http_user_agent" $http_x_forwarded_for';server
  30. {
  31.   listen 80;
  32.   server_name localhost;
  33.   index index.html index.htm index.php;
  34.   root  /home/wwwroot/default;
  35.   access_log  /home/wwwlogs/access.log  access;
  36.   location ~ .*\.(php|php5)?$
  37.    {
  38.     try_files $uri =404;
  39.     fastcgi_pass  unix:/tmp/php-cgi1.sock;
  40.     fastcgi_index index.php;
  41.     include fcgi.conf;
  42.    }
  43.   location /status {
  44.    stub_status on;
  45.    access_log   off;
  46.   }
  47.   location ~ .*\.(gif|jpg|jpeg|png|bmp|swf)$
  48.    {
  49.     expires      30d;   }
  50.   location ~ .*\.(js|css)?$
  51.    {
  52.     expires      12h;
  53.    }
  54. }
  55. server
  56. {
  57.   listen 80;
  58.   server_name xxxxxx.com;
  59.   index index.html index.htm index.php;
  60.   root  /home/xxxxxx/public_html;
  61.   location ~ .*\.(php|php5)?$
  62.    {
  63.     try_files $uri =404;
  64.     fastcgi_pass  unix:/tmp/php-cgi1.sock;
  65.     fastcgi_index index.php;
  66.     include fcgi.conf;
  67.    }
  68.   location /status {
  69.    stub_status on;
  70.    access_log   off;
  71.   }
  72.   location ~ .*\.(gif|jpg|jpeg|png|bmp|swf)$
  73.    {
  74.     expires      30d;   }
  75.   location ~ .*\.(js|css)?$
  76.    {
  77.     expires      12h;
  78.    }
  79. }include vhost/*.conf;
  80. }  
复制代码
美国VPS推荐: 遨游主机LinodeLOCVPS主机云搬瓦工80VPSVultr美国VPS主机中国VPS推荐: 阿里云腾讯云。LNMP付费服务(代装/问题排查)QQ 503228080
发表于 2013-12-13 10:32:37 | 显示全部楼层


fastcgi_pass  unix:/tmp/php-cgi1.sock; 这个地方有错误
如果不了解配置参数,不建议随便修改

再就是查看目录文件权限
Linux下Nginx+MySQL+PHP自动安装工具:https://lnmp.org
您需要登录后才可以回帖 登录 | 注册

本版积分规则

小黑屋|手机版|Archiver|VPS侦探 ( 鲁ICP备16040043号-1 )

GMT+8, 2024-9-25 07:24 , Processed in 0.024912 second(s), 16 queries .

Powered by Discuz! X3.4

© 2001-2023 Discuz! Team.

快速回复 返回顶部 返回列表