符号链接到不同用户/主目录下的PHP脚本;未指定输入文件";

符号链接到不同用户/主目录下的PHP脚本;未指定输入文件";,php,bash,apache,symlink,fastcgi,Php,Bash,Apache,Symlink,Fastcgi,我正在debian wheezy和标准PHP5.3以及fastcgi上使用apache2运行virtualmin 我有一个网站,它调用指向另一个用户主目录中的php文件的符号链接 因此/home/user1/public_html/adservice/被符号链接到/home/user2/public_html/ 问题是,如果我直接访问user2的php文件,它会工作,但如果我通过symlink访问它,它只会吐出“未指定输入文件”(我猜fastcgi找不到文件的路径?) 这是我针对user2的ph

我正在debian wheezy和标准PHP5.3以及fastcgi上使用apache2运行virtualmin

我有一个网站,它调用指向另一个用户主目录中的php文件的符号链接

因此/home/user1/public_html/adservice/被符号链接到/home/user2/public_html/

问题是,如果我直接访问user2的php文件,它会工作,但如果我通过symlink访问它,它只会吐出“未指定输入文件”(我猜fastcgi找不到文件的路径?)

这是我针对user2的php5.fcgi:

#!/bin/bash
PHPRC=$PWD/../etc/php5
export PHPRC
umask 022
export PHP_FCGI_CHILDREN
PHP_FCGI_MAX_REQUESTS=99999
export PHP_FCGI_MAX_REQUESTS
SCRIPT_FILENAME=$PATH_TRANSLATED
export SCRIPT_FILENAME
exec /usr/bin/php5-cgi
这是我对该virtualserver的apache配置:

SuexecUserGroup“#1012”“#1012” ServerName adserve.com ServerAlias www.adserve.com ServerAlias webmail.adserve.com ServerAlias admin.adserve.com DocumentRoot/home/adserve/public\u html ErrorLog/var/log/virtualmin/adserve.com\u error\u log CustomLog/var/log/virtualmin/adserve.com\u访问\u日志组合 ScriptAlias/cgi-bin//home/adserve/cgi-bin/ DirectoryIndex.html index.htm index.php index.php4 index.php5 选项-索引+包含noexec+FollowSymLinks+ExecCGI 通融 AllowOverride All Options=ExecCGI,Includes noexec,index,multiview,symlinksFownerMatch AddType应用程序/x-httpd-php.php AddHandler fcgid script.php AddHandler fcgid script.php5 FCGIWrapper/home/adserve/fcgi-bin/php5.fcgi.php FCGIWrapper/home/adserve/fcgi-bin/php5.fcgi.php5 通融 AllowOverride All Options=ExecCGI,Includes noexec,index,multiview,symlinksFownerMatch 重新启动发动机 RewriteCond%{HTTP_HOST}=webmail.adserve.com 重写规则^(.*)https://adserve.com:20000/ [R] RewriteCond%{HTTP_HOST}=admin.adserve.com 重写规则^(.*)https://adserve.com:10000/ [R] php RemoveHandler.php5 php_管理_值引擎关闭 IPCCommTimeout 31 FcgidMaxRequestLen 1073741824 (域adserve.com只是一个占位符)

关于如何解决fcgi路径解析问题(如果确实存在问题)有何建议


多亏了

我终于能够解决这个问题,放松了对我试图符号链接到的文件的整个遍历路径的权限。它需要对整个路径进行完全读取和执行访问才能按预期工作


多亏了所有的帮助

是不是
PHPRC=$PWD/./etc/php5
不是问题?当通过符号链接访问时,这不是错误的吗?(我不做php,所以我可能对此完全不感兴趣。)你检查过你的权限了吗?因为你试图用user2访问user1文件,而suexec不允许。我曾尝试禁用fastcgi,让php在apache的用户中以mod_php的形式运行……但我仍然得到完全相同的行为
VirtualHost XXXXXXXXXXX:80>
SuexecUserGroup "#1012" "#1012" 
ServerName adserve.com
ServerAlias www.adserve.com
ServerAlias webmail.adserve.com
ServerAlias admin.adserve.com
DocumentRoot /home/adserve/public_html
ErrorLog /var/log/virtualmin/adserve.com_error_log
CustomLog /var/log/virtualmin/adserve.com_access_log combined
ScriptAlias /cgi-bin/ /home/adserve/cgi-bin/
DirectoryIndex index.html index.htm index.php index.php4 index.php5
<Directory /home/adserve/public_html>
Options -Indexes +IncludesNOEXEC +FollowSymLinks +ExecCGI
allow from all
AllowOverride All Options=ExecCGI,Includes,IncludesNOEXEC,Indexes,MultiViews,SymLinksIfOwnerMatch
AddType application/x-httpd-php .php
AddHandler fcgid-script .php
AddHandler fcgid-script .php5
FCGIWrapper /home/adserve/fcgi-bin/php5.fcgi .php
FCGIWrapper /home/adserve/fcgi-bin/php5.fcgi .php5
</Directory>
<Directory /home/adserve/cgi-bin>
allow from all
AllowOverride All Options=ExecCGI,Includes,IncludesNOEXEC,Indexes,MultiViews,SymLinksIfOwnerMatch
</Directory>
RewriteEngine on
RewriteCond %{HTTP_HOST} =webmail.adserve.com
RewriteRule ^(.*) https://adserve.com:20000/ [R]
RewriteCond %{HTTP_HOST} =admin.adserve.com
RewriteRule ^(.*) https://adserve.com:10000/ [R]
RemoveHandler .php
RemoveHandler .php5
php_admin_value engine Off
IPCCommTimeout 31
FcgidMaxRequestLen 1073741824
</VirtualHost>