快疯了,求大家帮帮我,看下问题出在哪里 - V2EX
V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
Okra
V2EX    问与答

快疯了,求大家帮帮我,看下问题出在哪里

  •  
  •   Okra 2016-03-20 18:58:27 +08:00 2508 次点击
    这是一个创建于 3521 天前的主题,其中的信息可能已经有所发展或是发生改变。
    是这样的,我今天下午想在虚拟机 centos7 中配置 nginx + php + mysql 的环境,软件都装好了,能正常访问 html 页面,但是访问 php 页面的时候就是一片空白,在网页上查看源代码就是原来的 php 代码被注释掉了,下面这个样子:
    <-- <? php echo phpinfo(); -->
    <html>
    <head></head>
    <body></body>
    </html>

    nginx 和 php-fpm 正常运行, php-fpm 是监听 127.0.0.1:9000 端口,查看 nginx 和 php-fpm 的错误日志,访问 php 页面的时候也并没有错误日志生成。

    下面是我的 nginx 配置文件:

    server {
    listen 80;
    server_name localhost;

    #charset koi8-r;
    #access_log /var/log/nginx/log/host.access.log main;

    location / {
    root /usr/share/nginx/html;
    index index.html index.htm index.php;
    }

    #error_page 404 /404.html;

    # redirect server error pages to the static page /50x.html
    #
    error_page 500 502 503 504 /50x.html;
    location = /50x.html {
    root /usr/share/nginx/html;
    }

    # proxy the PHP scripts to Apache listening on 127.0.0.1:80
    #
    #location ~ \.php$ {
    # proxy_pass http://127.0.0.1;
    #}

    # pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
    #

    location ~ \.php$ {
    root /usr/share/nginx/html;
    fastcgi_pass 127.0.0.1:9000;
    fastcgi_index index.php;
    fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
    include fastcgi_params;
    }

    # deny access to .htaccess files, if Apache's document root
    # concurs with nginx's one
    #
    #location ~ /\.ht {
    # deny all;
    #}
    }

    求大家帮帮我!
    3 条回复    2016-03-20 20:39:10 +08:00
    yylzcom
        1
    yylzcom  
       2016-03-20 20:35:47 +08:00 via Android
    自动被注释掉?好神奇
    chairuosen
        2
    chairuosen  
       2016-03-20 20:36:41 +08:00 via iPhone
    hellojinjie
        3
    hellojinjie  
       2016-03-20 20:39:10 +08:00
    看看 ss -lnt
    确认下 php-fpm 是不是真的起来了
    关于     帮助文档     自助推广系统     博客     API     FAQ     Solana     1100 人在线   最高记录 6679       Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 26ms UTC 17:36 PVG 01:36 LAX 09:36 JFK 12:36
    Do have faith in what you're doing.
    ubao msn snddm index pchome yahoo rakuten mypaper meadowduck bidyahoo youbao zxmzxm asda bnvcg cvbfg dfscv mmhjk xxddc yybgb zznbn ccubao uaitu acv GXCV ET GDG YH FG BCVB FJFH CBRE CBC GDG ET54 WRWR RWER WREW WRWER RWER SDG EW SF DSFSF fbbs ubao fhd dfg ewr dg df ewwr ewwr et ruyut utut dfg fgd gdfgt etg dfgt dfgd ert4 gd fgg wr 235 wer3 we vsdf sdf gdf ert xcv sdf rwer hfd dfg cvb rwf afb dfh jgh bmn lgh rty gfds cxv xcv xcs vdas fdf fgd cv sdf tert sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf shasha9178 shasha9178 shasha9178 shasha9178 shasha9178 liflif2 liflif2 liflif2 liflif2 liflif2 liblib3 liblib3 liblib3 liblib3 liblib3 zhazha444 zhazha444 zhazha444 zhazha444 zhazha444 dende5 dende denden denden2 denden21 fenfen9 fenf619 fen619 fenfe9 fe619 sdf sdf sdf sdf sdf zhazh90 zhazh0 zhaa50 zha90 zh590 zho zhoz zhozh zhozho zhozho2 lislis lls95 lili95 lils5 liss9 sdf0ty987 sdft876 sdft9876 sdf09876 sd0t9876 sdf0ty98 sdf0976 sdf0ty986 sdf0ty96 sdf0t76 sdf0876 df0ty98 sf0t876 sd0ty76 sdy76 sdf76 sdf0t76 sdf0ty9 sdf0ty98 sdf0ty987 sdf0ty98 sdf6676 sdf876 sd876 sd876 sdf6 sdf6 sdf9876 sdf0t sdf06 sdf0ty9776 sdf0ty9776 sdf0ty76 sdf8876 sdf0t sd6 sdf06 s688876 sd688 sdf86