【发布时间】:2014-10-30 03:46:07
【问题描述】:
我正在尝试用 FastCGI 替换 SuPHP。 早些时候,我有不同所有者和组的文件夹。每个组也有 www-data 作为成员。 当使用浏览器运行任何 php 文件时,它会作为文件的所有者运行。 因此,如果文件由用户 A 拥有(组 A - www-data 和 A 作为成员),它将作为用户 A 执行
shell_exec('whoami') => return A
现在,我安装了 fastcgi 并将其配置为运行 PHP 文件。
这是我的 php5-fpm.conf 文件
<IfModule mod_fastcgi.c>
AddHandler php5-fcgi .php
Action php5-fcgi /php5-fcgi
Alias /php5-fcgi /usr/lib/cgi-bin/php5-fcgi
FastCgiExternalServer /usr/lib/cgi-bin/php5-fcgi -socket /var/run/php5-fpm.sock -pass-header Authorization
</IfModule>
我的问题是,现在当我运行属于 A 的同一个文件时,
shell_exec('whoami') => return www-data
我做错了什么?
【问题讨论】:
标签: php ubuntu apache2 fastcgi suphp