Link to home
Start Free TrialLog in
Avatar of nitaish
nitaish

asked on

IIS shows http headers in all php and perl pages

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?
Avatar of wizzie83
wizzie83

Do the scripts work and display headers? or do they show up as text?
Avatar of nitaish

ASKER

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.
can you show me the first lines of both scripts, the one that works and the one that does not.
You could also try to reinstall the 2 isapi filters
Are you using something like urlscan?


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.
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.


Avatar of nitaish

ASKER

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?
Try to disable all isapi modules except php.
Avatar of nitaish

ASKER

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.
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 ?
Avatar of nitaish

ASKER

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.
Avatar of nitaish

ASKER

Anyone with a solution?
ASKER CERTIFIED SOLUTION
Avatar of nitaish
nitaish

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial