PHP中的非解析标头 [英] Non Parsed Headers in PHP

查看:125
本文介绍了PHP中的非解析标头的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

使用CGI程序时,有一个IIS错误会导致标题出现问题,并将重定向设置为返回http 302(Object Moved)的页面。结果是IIS不解析标头,因此如果您尝试设置cookie,它将不起作用。请参阅知识库文章

There is an IIS bug that causes problems with headers when using a CGI program, and setting a redirect to a page that returns a http 302 (Object Moved). The result is that IIS doesn't parse the headers, so if you're trying to set cookies, it's not going to work. See the KB Article

说解决方案是用-nph(非解析标题)启动EXE CGI - 但我不确定它是否适用于PHP。我尝试将它添加到我的php文件并手动构建标题,但这对我不起作用..

It says the solution is to start the EXE CGI with -nph (Non parsed Headers) - but I'm not really sure if it works in PHP. I tried adding it to my php file and manually building headers, but that didn't work for me..

有没有人有这个问题?有什么好的解决方法吗?

Has anyone had this problem? Any good workarounds?

推荐答案

用nph-而不是-nph前缀PHP文件为我解决了这个问题。

Prefixing the PHP file with nph-, not -nph - solved this issue for me.

e.g. nph-test.php

这篇关于PHP中的非解析标头的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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