SOLVED: For some reason apache only processes PHP if it is wrapped in <?php ?> tags, it won't process PHP wrapped in <? ?> tags. Thats a first for me, usually <? ?> tags work fine.
I'm installing PHP and apache on a Windows machine at college but its been a long time since I've installed one of these servers on Windows (I switched to linux years ago, installing a LAMP server is much more straight forward than a WAMP). I followed the steps in the following tutorial:
http://www.reaper-x.com/2007/09/24/installing-and-setting-up-apache-22-series-with-php-5-on-windows/but when I point apache to a PHP script, it filters out the <? ?> tags but it doesn't process the PHP at all. For example, if the .php file contains <? echo "String1"; ?><p>String2</p>, it will only print String2. In older versions of PHP5, there was a php.ini-recommended file which I used as php.ini but now there is only php.ini-development and php.ini-production. Which one should I use?
EDIT: I should mention that PHP works when I run it from the command line (c:\php\php-cgi test.php), it just won't work when I point the browser to it (localhost/test.php). The problem must be with how the apache server is configured.