问题描述
每当我在PHP code返回一些状态code,Zend服务器给了我下面所附的在我的网站的底部误差(与我返回的HTTP code的消息)。因此,举例来说,如果我回到401,它给了我一个401错误添加到我的381页:
Every time I return some status code in my PHP code, Zend Server gives me following error appended on the bottom of my website (with the message of HTTP code I returned). So for example, if I return 401, it gives me another 401 error appended to my 401 page:
有没有办法把它关掉?我使用。
Is there any way to turn it off? I use Zend Server Community Edition 5.0 with PHP 5.2.
编辑:
这似乎是默认的Apache错误处理。有没有一种方法来禁用它? preferably无需我自己的错误页面。
It seems to be default Apache error handling. Is there a way to disable it? Preferably without having my own error pages.
其他编辑:
我试着用ErrorDocument命令编辑我的.htaccess。它仍然给了我,我的错误页面(空白页)+ Apache的错误(就像上面的截图)。
I tried to edit my .htaccess with ErrorDocument directives. It still gives me my error page (blank page) + Apache error (like on screenshot above).
这是不是ZendServer对其进行访问4我在服务器上发生的事情。我使用本地主机上寿ZendServer对其进行访问5。是否有可能是某种错误或配置错误的从Zend的一面呢?
This isn't happening with ZendServer 4 I have on server. I use ZendServer 5 on localhost tho. Is it possible to be some kind of bug or misconfiguration from Zend side?
行为:
(在所有测试情况下,我回到401)
(In all test cases I return 401)
当我在.htaccess中使用默认配置ZendServer对其进行访问+ ErrorDocument命令,我让我自己的错误页面+ Apache的错误页面追加波纹管吧。
When I use default ZendServer configuration + ErrorDocument directives in .htaccess, I get my own error page + Apache error page appended bellow it.
当我使用默认配置ZendServer对其进行访问禁用+我自己的ErrorDocument指令,我得到的只是Apache的错误页面。
When I use default ZendServer configuration + disable my own ErrorDocument directives, I get just Apache error page.
当我改变Apache的错误页面的空白文件+使用自己的ErrorDocument指令,我得到想要的行为,但是错误还是404追加默认的Apache错误波纹管我自己的。
When I change Apache error pages to blank files + use my own ErrorDocument directives, I get the desired behavior, however errors 404 still append default Apache errors bellow my own.
推荐答案
我不认为你会想一定为禁用的错误。你需要做的是找出是所报告的错误(通过日志文件),然后你可能会发现权限问题,或实际上失败和倾倒它的核心的PHP脚本。
I don't think you'll necessarily want to "disable" that error. What you need to do is find out what error is being reported (go through the log file) and then you'll probably find a permission issue or a PHP script that's actually failing and dumping it's core.
要覆盖的Apache默认的错误页面,你可以把下面的行.htaccess文件或你的httpd.conf配置。
To override a default error page in apache, you can place the following line in an .htaccess file or in you httpd.conf config.
ErrorDocument 401 /path/to/the/new/error/page.html
这适用于要覆盖所有的错误页面。因此,只要改变状态code至503对于那些errors..etc ..
that applies to all error pages you want to override. So just change the status code to 503 for those errors..etc..
更多信息:
这篇关于如何关闭默认的HTTP状态code错误在Zend服务器?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!