We help IT Professionals succeed at work.

IIS shows http headers in all php and perl pages

nitaish
nitaish asked
on
I recently reinstalled IIS and restored it using the old Metabase. Now, after doing so, all the php and perl pages show HTTP Headers. Here is the http header

HTTP/1.1 200 OK Connection: close Date: Tue, 08 Jun 2010 06:35:02 GMT Content-Type: text/html Server: Microsoft-IIS/6.0 X-Powered-By: PHP/5.2.13

What can be the issue? Is there any setting to be done in the IIS or in the metabase to disable the http headers from being displayed in the pages?
Comment
Watch Question

Commented:
Do the scripts work and display headers? or do they show up as text?

Author

Commented:
The text is shown after the scripts execute. However, I am add a simple hello world script, then I don't get the http headers displayed.

Commented:
can you show me the first lines of both scripts, the one that works and the one that does not.

Commented:
You could also try to reinstall the 2 isapi filters

Commented:
Are you using something like urlscan?

Commented:


X-Powered-By: PHP/5.2.13

is an optional header that you can edit. This can be anything you want it to be. You can remove this.

Removing this is very simple:
http://www.petefreitag.com/item/722.cfm

The server banner header is hard coded in IIS.

This is the :

Server: Microsoft-IIS/6.0

Removing this is more complex and will require installing an ISAPI filter. Something like URLscan will do the trick.

Commented:
I just want to add having server banner headers is not a real security risk.

There are many ways of working out what your server on. Netcraft.com uses more than just the banner info to work it out.


Author

Commented:
A simple phpinfo script shows the http headers at many places in the page and a hello world script does not show any. Following are the codes

1. PHP Info

<?php
phpinfo();
?>

2. Hello World

<?php
echo "Hello World!!!!";
?>

Can you figure out the reason? I also installed  URL Scan which was not installed earlier. It did not make any difference. What else can be done?

Commented:
Try to disable all isapi modules except php.

Author

Commented:
Will it not create problems in running ASP.NET as one of the ISAPI Modules is ASP.NET_2.0.50727.0. Also I have PHP installed as a cgi module instead of ISAPI.

Commented:
So they are showing *in*/displayed on the page? Or do you mean this header conetnt is contained in the headers and you want to remove it ?

Author

Commented:
The following text appears at random places in the body of the php and perl pages.

HTTP/1.1 200 OK Connection: close Date: Tue, 08 Jun 2010 06:35:02 GMT Content-Type: text/html  Server: Microsoft-IIS/6.0 X-Powered-By: PHP/5.2.13

I want to disable this from being displayed in the body of the pages.

Author

Commented:
Anyone with a solution?
Commented:
The problem surprisingly got resolved automatically. All I did was uninstall URLscan from the server and reset  IIS. I had done the same earlier, but it did not help. However, today suddenly the problem got resolved. I am not sure if this was the reason for the problem getting resolved.