VPS侦探论坛

 找回密码
 注册
查看: 6219|回复: 10

php解析为空白

[复制链接]
发表于 2013-12-11 14:07:49 | 显示全部楼层 |阅读模式

军哥好我建了一个二级域名用来放phpmyadmin,现在的问题是图片都可以解析访问,php页面显示404

访问二级域名就直接空白,查看源文件可以看到页面有内容,但是就是显示不了

同一个vps的其他网站都正常。能给个方向么
谢谢。
美国VPS推荐: 遨游主机LinodeLOCVPS主机云搬瓦工80VPSVultr美国VPS主机中国VPS推荐: 阿里云腾讯云。LNMP付费服务(代装/问题排查)QQ 503228080
发表于 2013-12-11 15:19:25 | 显示全部楼层


发该虚拟主机的配置文件看看
Linux下Nginx+MySQL+PHP自动安装工具:https://lnmp.org
 楼主| 发表于 2013-12-12 09:44:22 | 显示全部楼层

我在里面随便建了一个phpinfo文件可以正常解析
该主机配置文件如下

log_format  test.example  '$remote_addr - $remote_user [$time_local] "$request" '
             '$status $body_bytes_sent "$http_referer" '
             '"$http_user_agent" $http_x_forwarded_for';
server
        {
                listen       80;
                server_name test.example;
                index index.php;
                root  /home/wwwroot/test.example;

                include other.conf;
                location ~ .*\.(php|php5)?$
                        {
                                try_files $uri =404;
                                fastcgi_pass  unix:/tmp/php-cgi.sock;
                                fastcgi_index index.php;
                                fastcgi_param  SCRIPT_FILENAME /home/wwwroot/test.example$fastcgi_script_name;
                                include fcgi.conf;
                        }

                location ~ .*\.(gif|jpg|jpeg|png|bmp|swf)$
                        {
                                expires      30d;
                        }

                location ~ .*\.(js|css)?$
                        {
                                expires      12h;
                        }

                access_log  /home/wwwlogs/test.example.com.log  test.example.com;
        }
美国VPS推荐: 遨游主机LinodeLOCVPS主机云搬瓦工80VPSVultr美国VPS主机中国VPS推荐: 阿里云腾讯云。LNMP付费服务(代装/问题排查)QQ 503228080
发表于 2013-12-12 10:37:58 | 显示全部楼层



把你自己加的fastcgi_param  SCRIPT_FILENAME /home/wwwroot/test.example$fastcgi_script_name; 删掉,重启nginx
Linux下Nginx+MySQL+PHP自动安装工具:https://lnmp.org
 楼主| 发表于 2013-12-12 10:47:39 | 显示全部楼层

已经删除,昨天是我找资料找的办法,加上去也不行,才来发帖子询问了
现在删除了还是不行。。

军哥运维代购:http://shop63846532.taobao.com/

 楼主| 发表于 2013-12-12 11:18:29 | 显示全部楼层

要不要升级下nginx试试,现在还是1.0默认版本
看最新的已经是1.4.4了
 楼主| 发表于 2013-12-12 11:52:57 | 显示全部楼层

已升级为最新的1.4.4
美国VPS推荐: 遨游主机LinodeLOCVPS主机云搬瓦工80VPSVultr美国VPS主机中国VPS推荐: 阿里云腾讯云。LNMP付费服务(代装/问题排查)QQ 503228080
发表于 2013-12-12 15:37:32 | 显示全部楼层

删除后该虚拟主机的nginx配置就没问题了,还改其他配置了没,你的是什么程序,添加时报错了没?
Linux下Nginx+MySQL+PHP自动安装工具:https://lnmp.org
 楼主| 发表于 2013-12-12 16:13:35 | 显示全部楼层


自己基于mvc框架开发的我把nginx.conf配置发上来看看自己的站运行的正常,但是phpmyadmin就不行,最新版的。权限应该没问题吧都是git目录的php.ini当初改了一部分..
user  git git;

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.
worker_rlimit_nofile 51200;

events
        {
                use epoll;
                worker_connections 51200;
        }

http
        {
                include       mime.types;
                default_type  application/octet-stream;
                server_names_hash_bucket_size 128;
                client_header_buffer_size 32k;
                large_client_header_buffers 4 32k;
                client_max_body_size 50m;
                sendfile on;
                tcp_nopush     on;
                fastcgi_intercept_errors on;
                keepalive_timeout 60;
                tcp_nodelay on;
                fastcgi_connect_timeout 1300;
                fastcgi_send_timeout 1300;
                fastcgi_read_timeout 1300;
                fastcgi_buffer_size 64k;
                fastcgi_buffers 4 64k;
                fastcgi_busy_buffers_size 128k;
                fastcgi_temp_file_write_size 256k;
                gzip on;
                gzip_min_length  1k;
                gzip_buffers     4 16k;
                gzip_http_version 1.0;
                gzip_comp_level 2;
                gzip_types       text/plain application/x-javascript text/css application/xml text/javascript application/x-httpd-php image/jpeg image/gif image/png;
                gzip_vary on;
                gzip_proxied        expired no-cache no-store private auth;
                gzip_disable        "MSIE [1-6]\.";
                #limit_zone  crawler  $binary_remote_addr  10m;
                server_tokens off;
                #log format
                log_format  access  '$remote_addr - $remote_user [$time_local] "$request" '
             '$status $body_bytes_sent "$http_referer" '
             '"$http_user_agent" $http_x_forwarded_for';
server

                listen       80;
                server_name example;
                index index.php;
                root  /home/wwwroot/default;
        #       location ~ .*\.(php|php5)?$
        #               {
        #                       try_files $uri =404;
        #                       fastcgi_pass  unix:/tmp/php-cgi.sock;
        #                       fastcgi_index index.php;
        #                       include fcgi.conf;
        #               }

                location /status {
                        stub_status on;
                        access_log   off;
                }

                location ~ .*\.(gif|jpg|jpeg|png|bmp|swf)$
                        {
                                expires      30d;
                        }

                location ~ .*\.(js|css)?$
                        {
                                expires      12h;
                        }

                access_log  /home/wwwlogs/access.log  access;
        }
include vhost/*.conf;
}

军哥运维代购:http://shop63846532.taobao.com/

发表于 2013-12-12 20:01:34 | 显示全部楼层



你配置文件改了好几个地方
phpmyadmin在默认的虚拟主机目录,你把php的解析去掉了,phpmyadmin也就没法用了,默认的配置只要安装成功了,肯定不会有问题
 楼主| 发表于 2013-12-13 09:58:55 | 显示全部楼层

是的,军哥,改了不少地方

最早时候刚装好1.0的时候,默认的default的phpmyadmin是可以运行的

自己开发的系统example.com也是可以正常使用的。我一共三个主机
example.com主站,目前没问题
static.example.com存图片和静态文件,这个把配置文件的解析php那一段删除了
test.example.com用来装phpmyadmin的,现在就是出问题了。。

麻烦军哥给个建议。
您需要登录后才可以回帖 登录 | 注册

本版积分规则

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

GMT+8, 2024-9-25 07:22 , Processed in 0.029245 second(s), 17 queries .

Powered by Discuz! X3.4

© 2001-2023 Discuz! Team.

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