VPS侦探论坛

 找回密码
 注册
查看: 4845|回复: 2

我已经取消了上传目录的PHP执行权限,为什么PHP还是可以执行?

[复制链接]
发表于 2013-9-2 14:38:04 | 显示全部楼层 |阅读模式

server
        {
                listen       80;
                server_name www.abc.com;
                index index.html index.htm index.php default.html default.htm default.php;
                root  /home/wwwroot/abc;
                include none.conf;
                location ~ /(data|uploads|templets)/.*\.(php|php5)?$ {
                deny all;
                }
                location ~ .*\.(php|php5)?$
                        {
                                try_files $uri =404;
                                fastcgi_pass  unix:/tmp/php-cgi.sock;
                                fastcgi_index index.php;
                                include fcgi.conf;
                        }

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

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

                access_log off;
        }


按照:https://www.vpser.net/security/lnmp-remove-nginx-php-execute.html

修改的/usr/local/nginx/conf/vhost/abc.conf

取消了目录的PHP执行权限,为什么我传了个index.php
  “<?php
  echo "hello, world\n";
?>”

还是可以执行??

请教问题出在哪里??
美国VPS推荐: 遨游主机LinodeLOCVPS主机云搬瓦工80VPSVultr美国VPS主机中国VPS推荐: 阿里云腾讯云。LNMP付费服务(代装/问题排查)QQ 503228080
 楼主| 发表于 2013-9-2 15:10:08 | 显示全部楼层


测试nginx配置  /usr/local/nginx/sbin/nginx -t  没问题
结果如下:nginx: the configuration file /usr/local/nginx/conf/nginx.conf syntax is ok
nginx: configuration file /usr/local/nginx/conf/nginx.conf test is successful

执行:/usr/local/nginx/sbin/nginx -s reload  是配置生效也没问题

在完成这些操作之后  我又重启了LNMP
Linux下Nginx+MySQL+PHP自动安装工具:https://lnmp.org
发表于 2013-9-2 20:03:05 | 显示全部楼层

配置上没问题
美国VPS推荐: 遨游主机LinodeLOCVPS主机云搬瓦工80VPSVultr美国VPS主机中国VPS推荐: 阿里云腾讯云。LNMP付费服务(代装/问题排查)QQ 503228080
您需要登录后才可以回帖 登录 | 注册

本版积分规则

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

GMT+8, 2024-9-24 23:29 , Processed in 0.026102 second(s), 16 queries .

Powered by Discuz! X3.4

© 2001-2023 Discuz! Team.

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