我正在与一位同事一起在XAMPP中的MAC上设置本地环境,在Windows上,我的虚拟主机看起来像下面那样。在documentroot(cgi-bin文件夹)之外运行PHP文件
当我访问诸如http://domain.local/cgi-bin/handler.php一个URL的Web服务器正确处理PHP,但在他的,我们得到一个500服务器错误和消息...
The server encountered an internal error and was unable to complete your request.
Error message:
Premature end of script headers:
我们试图改变的cgi-bin的名字文件夹到别的东西,因为我注意到在httpd.conf中有另一个别名,但这没有效果......所以在我看来,这个问题与权限有关。
我们认为别名设置正常,因为访问http://domain.local/cgi-bin/filenothere.php不存在将抛出一个404像预期的那样,任何.html/.pl文件无法执行。
存在于在cgi-bin文件夹是权限...
rwxrwxrwx戴夫人员
,并通过用户和组拥有....
戴夫人员
Vhost
<VirtualHost *:80>
ServerAdmin [email protected]
ServerName www.domain.local
ServerAlias domain.local
ServerAlias api.domain.local
# Indexes + Directory Root.
DirectoryIndex index.php
DocumentRoot E:/home/www/www.domain.co.uk/htdocs/
# CGI Directory
ScriptAlias /cgi-bin/ E:/home/www/www.domain.co.uk/cgi-bin/
<Location /cgi-bin>
Options +ExecCGI
</Location>
# Logfiles
ErrorLog E:/home/www/www.domain.co.uk/logs/error.log
CustomLog E:/home/www/www.domain.co.uk/logs/access.log combined
</VirtualHost>
任何想法是什么导致这个PHP文件不被执行?
UPDATE 试图添加一个头来说PHP的内容是PHP的开始,现在只需输出PHP代码。
它仿佛在为别名指定的路径是可访问的,但服务器不知道如何执行的内容,这是对HTML和PHP
你确定问题不在handler.php中吗?该文件的权限是什么? –
权限是递归设置的整个文件夹,试图使其工作。 我更新了一些额外信息的问题。 – Carlton
感谢您的建议家伙,今天会看看他们,并尝试分配这个赏金 – Carlton