PHP: Block all http headers

Posted on 2011-05-05
Medium Priority
Last Modified: 2012-05-11
I don't want PHP or Apache to send out ANY headers at all.

Using PHP, how can I block or prevent all standard headers?
Question by:hankknight

Assisted Solution

Rik-Legger earned 80 total points
ID: 35699706
You can overwrite the headers by yourself using the header() function.
Deleting the headers, i don't think that is possible.
LVL 111

Assisted Solution

by:Ray Paseur
Ray Paseur earned 320 total points
ID: 35699864
Can you tell us a little more about why you want to do this?  It certainly is not part of any design pattern that would make sense over the internet.  So if you can tell us a little more we might be able to give you some ideas about how to do what you want to do.
LVL 16

Author Comment

ID: 35699950
I want to have full control over the headers my PHP application is sending.

I cannot seem to remove the "Server" header no matter what I try.
Server: Apache/2.2.8 (EL)

I also don't like the way Apache interferes with my implementation of 304 headers.
LVL 48

Accepted Solution

hernst42 earned 1600 total points
ID: 35700246

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I imagine that there are some, like me, who require a way of getting currency exchange rates for implementation in web project from time to time, so I thought I would share a solution that I have developed for this purpose. It turns out that Yaho…
Part of the Global Positioning System A geocode (https://developers.google.com/maps/documentation/geocoding/) is the major subset of a GPS coordinate (http://en.wikipedia.org/wiki/Global_Positioning_System), the other parts being the altitude and t…
The viewer will learn how to dynamically set the form action using jQuery.
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …
Suggested Courses
Course of the Month13 days, 18 hours left to enroll

807 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question