473,800 Members | 2,368 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Sending HTTP response headers causes errors

I'm in the process of moving my site from one server to another (my old
hosting company appears to have gone bust).

On the old host and on my local Mac OS X machine I can send HTTP/1.1
response headers with no problem (e.g. header( 'HTTP/1.1 200 OK' ).

If I do the same on the new server I get redirected to the server's
'Internal Error' page (i.e. error 500). No indication of what the error
is.

All three servers are running PHP/4.1.2 and either Apache 1.3.26 or
1.3.27.

It appears that the new server does not like me calling header() with
any string without a colon. If do header('Henry Horse') it also causes
an error. The other servers don't. Equally, if I put a colon in the
HTTP header it also doesn't cause an error (though the header is then
meaningless).

I have no control over httpd.conf or what modules are installed. I do
have access to .htaccess. I also have no access to the error log.

Anyone got any idea what's causing this and is there a way around it?

--
Pete
====
*** Email is pete -at- dawnsun -dot- net
Jul 17 '05 #1
2 5378
In article <20************ *********@email .in.my.sig>,
Peter Gaunt <pe**@email.in. my.sig> wrote:
I'm in the process of moving my site from one server to another (my old
hosting company appears to have gone bust).

On the old host and on my local Mac OS X machine I can send HTTP/1.1
response headers with no problem (e.g. header( 'HTTP/1.1 200 OK' ).

If I do the same on the new server I get redirected to the server's
'Internal Error' page (i.e. error 500). No indication of what the error
is.

All three servers are running PHP/4.1.2 and either Apache 1.3.26 or
1.3.27.

It appears that the new server does not like me calling header() with
any string without a colon. If do header('Henry Horse') it also causes
an error. The other servers don't. Equally, if I put a colon in the
HTTP header it also doesn't cause an error (though the header is then
meaningless) .

I have no control over httpd.conf or what modules are installed. I do
have access to .htaccess. I also have no access to the error log.

Anyone got any idea what's causing this and is there a way around it?

--
Pete
====
*** Email is pete -at- dawnsun -dot- net


Pete,

Apache may be configured on the failing server to override specific headers.
You should be able to work around this by prefixing your 'HTTP...' header
with 'Status: HTTP/1.1 200 OK'.

Billy
Jul 17 '05 #2
In article <pp************ @kudzu.thrillse eker.net>, Billy Harvey
<Bi**********@t hrillseeker.net > wrote:
In article <20************ *********@email .in.my.sig>,
Peter Gaunt <pe**@email.in. my.sig> wrote:
I'm in the process of moving my site from one server to another (my old
hosting company appears to have gone bust).

On the old host and on my local Mac OS X machine I can send HTTP/1.1
response headers with no problem (e.g. header( 'HTTP/1.1 200 OK' ).

[snip]
Apache may be configured on the failing server to override specific headers.
You should be able to work around this by prefixing your 'HTTP...' header
with 'Status: HTTP/1.1 200 OK'.


I tried that. Worked in some cases and not others.

I've now discovered a difference between the three servers. My old
server and my local server are configured to run PHP as an Apache
module. The new one is configured to run it as a CGI module. If I add
'RemoveHandler .php' to the .htaccess file on the new server, PHP then
runs as an Apache module there too and the problems with the headers go
away. I haven't the faintest idea why this should be. Anyone?

Running as an Apache module also has some side-effects. When I moved the
site the server_signatur e variable (and one or two others) vanished.
Now with PHP running as an Apache module they've reappeared.

--
Pete
====
*** Email is pete -at- dawnsun -dot- co -dot- uk
Jul 17 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
3853
by: John Davis | last post by:
Any ASP functions can get the HTTP request and response headers? Thanks! John
1
2176
by: mike | last post by:
regards: I write java code to simulate my machine as a HTTP server, what is the "MUST REPLY" HTTP response headers? In my small survey,I think there are 2 "MUST REPLY" HTTP response headers. (1)Content-Length: (length of content which will be transmitted) (2)Content-Type: (by
1
2912
by: Alfons Puig | last post by:
Hi, MSDN documentation about HTTP Response Headers say Refresh is obsolete and maintained for legacy application compatibility only. How can I achieve the same functionality to releoad the new contents of a page? I can use the timer component but, is there a http-like solution?
0
1045
by: Shachar Tal | last post by:
Hi All, I'm implementing an ASP.NET http module that logs all incoming and outgoing HTTP traffic. While I have sufficient data available through the HttpRequest object, I cannot say the same regarding HttpResponse. There is simply no way to access the response headers! Has anyone run into this before? If so, how did you resolve the issue? I'd appreciate a swift response...
0
1402
by: SimonDev | last post by:
Hi I've got an unusual problem I'm hoping someone could advise me on, regarding the formatting of the body of an HTTP response from a web service. We are using HTTP POST rather than SOAP for calling web methods to save network traffic over a cellular network. Each web method returns an XmlDocument with a <resproot element. Most web methods simply return a single value as the content of the <respelement (integer or string). However...
2
1281
by: pbd22 | last post by:
Hi. I feel like i should know this but i dont. How do I get the server to send a specific HTTP response to the browser? I want to tell the browser that there is no content coming back from ther server and I want to do it in the HTTP Headers. The status code is "204" for no content.
1
5526
by: deerchao | last post by:
I'm writing my IHttpHandler, but whenever I call members of "HttpContext.Current.Response.Headers", I got an PlatformNotSupportedException says "This operation requires IIS integrated pipeline mode.". Is there no way to use HTTP headers in custom HttpHandlers? Thanks!
3
7127
by: =?Utf-8?B?enBlcmV0eg==?= | last post by:
Hallo, I Can't get reed of http response headers . Thow I used : Response.ClearHeaders witch MSDN say's it should clear up all http headers I'm on VS 2005 - windows xp IIS Thank you
22
4906
by: Chris G | last post by:
Hi, I have a loop in which I'm making Ajax xmlhttp requests. This occurs within a function triggered by a window.onload event. The Ajax calls are being made with async=false, because they need to occur in a specific order that relies on each step completing before the next can occur. With each successive request in the loop, I'm updating a div with the xmlhttp.responseText. Firefox is refreshing between calls as desired.
0
9691
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9551
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10276
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10253
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9090
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7580
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6813
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5471
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
4149
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.