location header在内容写完后工作......为什么? [英] location header WORKING after content written...why?

查看:70
本文介绍了location header在内容写完后工作......为什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

据我所知,在内容写完后,http标题不起作用。这就是我的生产盒工作的方式,但出于某种原因

在我的开发盒上我在内容后得到了一个位置标题

(一些调试笔记)被写了。


为了确定,我在标题(''位置:

''...)调用之前扔了一个die(),确定屏幕上有相同的东西

活箱子正在窒息。


所以有人对我可能设置的内容有任何想法允许我

来逃避这个?这不是我喜欢的能力。环境是在Redhat AS3上的
Apache 2。


非常感谢

解决方案

2005年4月20日10:48:16 -0700, pi****@gmail.com 写道:

据我所知,http标题在写完内容后不起作用。这就是我的生产盒工作的方式,但出于某种原因,在我的开发盒上,我在内容
(一些调试笔记)写完之后就得到了一个位置标题。
为了确定,我在标题(''位置:
''...)调用之前扔了一个die(),确定屏幕上有相同的东西
活盒子很窒息。

所以有人对我可能设置的内容有任何想法,这让我可以躲开这个吗?这不是我喜欢的能力。环境是Redhat AS3上的Apache 2。




如果打开输出缓冲并且你写了标题,你就可以侥幸成功
$ b第一次冲洗前$ b。


-

Andy Hassall /< an ** @ andyh.co.uk> /< http://www.andyh.co.uk>

< http://www.andyhsoftware.co.uk/space>空间:磁盘使用情况分析工具


pi **** @ gmail.com 写道:

:据我所知,在内容已经写完后,http标题不起作用。这就是我的生产盒工作方式,但出于某种原因

:在我的开发盒上,我在内容后得到了一个位置标题

:(一些调试说明)写的。


也许调试消息不会发送到stdout,也许stdout没有被发送到浏览器。


-


这个空间不用于出租。


没有输出缓冲 - 至少没有ob_start调用所涉及文件的任何

。是否可以作为

服务器配置进行某种缓冲?这听起来很奇怪。


另外,有问题的调试归结为print_r调用,所以我没有明确做任何事情来做路由输出任何不寻常的。


感谢您的回复。


仍然感到困惑。


As far as I know, http headers should not work after content has been
written. This is how my production box is working, but for some reason
on my dev box I was getting away with a location header after content
(some debug notes) was written.

Just to be sure, I threw a die() in right before the header(''Location:
''...) call, and sure enough there was the same stuff on screen that
the live box is choking on.

So does anyone have any ideas on what I might have set that allowed me
to get away with this? It''s not a capability I enjoy. Environment is
Apache 2 on Redhat AS3.

Many thanks

解决方案

On 20 Apr 2005 10:48:16 -0700, pi****@gmail.com wrote:

As far as I know, http headers should not work after content has been
written. This is how my production box is working, but for some reason
on my dev box I was getting away with a location header after content
(some debug notes) was written.

Just to be sure, I threw a die() in right before the header(''Location:
''...) call, and sure enough there was the same stuff on screen that
the live box is choking on.

So does anyone have any ideas on what I might have set that allowed me
to get away with this? It''s not a capability I enjoy. Environment is
Apache 2 on Redhat AS3.



You can get away with it if output buffering is on and you write the header
before the first flush.

--
Andy Hassall / <an**@andyh.co.uk> / <http://www.andyh.co.uk>
<http://www.andyhsoftware.co.uk/space> Space: disk usage analysis tool


pi****@gmail.com wrote:
: As far as I know, http headers should not work after content has been
: written. This is how my production box is working, but for some reason
: on my dev box I was getting away with a location header after content
: (some debug notes) was written.

perhaps the debug messages are not going to stdout, and perhaps stdout is
not being sent to the browser.

--

This space not for rent.


No output buffering going on--at least theres no ob_start calls in any
of the files involved. Could there be some kind of buffering as a
server configuration? That sounds pretty strange.

Also, the debug in question boils down to a print_r call, so I haven''t
knowingly done anything to route that output anywhere unusual.

Thanks for the replies, of course.

Still baffled.


这篇关于location header在内容写完后工作......为什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆