Page 1 of 1

PHP isn't processing code

Posted: Sat Feb 03, 2007 11:40 pm
by Caislean
I set up Apache 2.2.4 and PHP 5.2.0 on Windows XP Pro. Apache runs perfectly and generates no errors (absolutely none). It loads PHP properly (apache tells me it has successfully loaded the php module). As far as I can tell all of my configuration files for both Apache and PHP are correct. However, when I view test code on my server it isn't processed. For example, if I put php in an .html file, the code doesn't execute and the code shows up in the source file. My server does not use short tags, and neither doe my code.

Some how the code isn't getting processed. Any ideas?

I've had no luck posting on previous Apache or PHP forums - no one has come up with the correct solution, and I can't believe the problem can be something overly complex. When I post on apache, they say ask in php. When I ask in php they say ask on apache.

Any help would be greatly appreciated. To help you along here are the lines from the Apache server that deal with php:

Code: Select all

#PHP Stuff
PHPIniDir "C:\PHP\"
LoadModule php5_module "C:\PHP\php5apache2_2.dll"
AddType application/x-httpd-php .php
AddHandler application/x-httpd-php .php
Action application/x-httpd-php "c:\PHP\php.exe"
As far as the Apache server goes, it doesn't matter what I comment out - I've tried each combination - and PHP still fails to be processed.

And here is the sample HTML code that doesn't run:

Code: Select all

<html>
	<head>
		<title>PHP Test 2</title>
	</head>
	<body>
	<p>Testing php...</p>
	<p>
		<?php
			$a = 50; 
			$b = 75; 
			$c = $a + $b;
			echo $c;
		?>
	</p>
	<p>
	</body>
</html>
It should also be noted that from the command prompt PHP code runs fine. For example, I can write code and then do "php testcode.php" without any errors.

Posted: Sat Feb 03, 2007 11:50 pm
by feyd
Your configuration settings don't include .html in the file extensions to parse.

Posted: Sun Feb 04, 2007 10:30 am
by Caislean
Ah - I knew it had to be something simple. And believe it or not, no one had pointed that out before.

Thank you!