Linux Php 运行权限的问题

WBOY
Release: 2016-06-23 13:53:12
Original
1388 people have browsed it

问题描述:
执行 httpd 的用户是httpd 所属httpd用户组

DocumentRoot: /webroot httpd httpd drwxrwx---
/webroot/index.html httpd httpd -r--------
/webroot/index.php httpd httpd -r--------

index.html跟index.php都能正常访问

在linux系统下,index.php不需要执行权限的吗?



回复讨论(解决方案)

在linux系统下,index.php不需要执行权限的吗?


执行权限指的是可运行的进程程序。类似于config、configure、make……
普通的.php、.html文件只要有可读权限就可以,当然有些配置文件需要读写权限。

整形权限是指./command
而普通的web访问并不是如此执行的,而是解析的,所以并不需要,如果是./command来执行php的话,那么就需要了

引用楼主  的回复:
在linux系统下,index.php不需要执行权限的吗?

执行权限指的是可运行的进程程序。类似于config、configure、make……
普通的.php、.html文件只要有可读权限就可以,当然有些配置文件需要读写权限。


那在做安全部署的时候,对于可写的目录可能存在的安全隐患,应该去掉该目录的执行权限就可以了?

一般而言,index.php是不需要的。

仅在apache的CGI模式下,需要脚步文件具备可执行权限并在文件首行指定解释器。
其它模式下均不需要,只要保证文件和目录可读即可

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!