Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

PHP Problem on NT4 IIS4

Status
Not open for further replies.

climan

ISP
May 5, 2002
7
0
0
US
Hello, I have been given the task of getting php to run correctly on our nt4 machine, I installed the newest exe from php.net ( file was PHP 4.2.1 installer ) after that I ran a phpinfo test and you can see that at That ran fine and seems that php runs great but any actual php script I try allways gives an error, these scripts are very simple just to test the server and they worked great on my redhat 7.2 machine running apache. Do you have any ideas what may be up here?

Once again I am running NT 4.0 and IIS 4.0, I do not have the option of changing eather of these.

Here is the code to a simple script I made just to test that won't work the actual page on my server for this is
<html>
<head>
<title>Using Comparison Operators</title>
</head>
<body>
<?
$a = 21;
$b = 15;
echo &quot;<p>Original value of \$a is $a and \$b is $b</p>&quot;;
if ($a == $b) {
echo &quot;<p>TEST 1: \$a equals \$b</p>&quot;;
} else {
echo &quot;<p>TEST 1: \$a is not equal to \$b</p>&quot;;
}

if ($a != $b) {
echo &quot;<p>TEST 2: \$a is not equal to \$b</p>&quot;;
} else {
echo &quot;<p>TEST 2: \$a is equal to \$b</p>&quot;;
}

?>
</body>
</html>
 
IIS runs PHP as a CGI application, therefor your scripts must return a full set of HTTP headers. I think there are some configuration directives in the php.ini file for this behaviuor. If you can't find it, try adding <?php
header('Content-type: text/html');
?> to the beginning of the scripts. //Daniel
 
Thanks for the suggestion of adding the code to the beginning of the pages, I tried that and to no avail, I didn't see what you were talking about in the php.ini file though, I am posting a link to a copy of my php.ini file here if you want to see it. Thanks.

 
Well I figured it out, and I do not want to admit to what it actually was though, well I guess I might as well in case someone else ever does the same thing,

When I created the files I made then in notepad and did not put quotes around the filename to preserve the filename, so it was actually saved as test.php.txt I am used to using vi in unix where this is not a problem, sorry for the trouble.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top