Suggestion: Post the code for 'test.php' (using the appropriate tags.) View the source of the page in your web browser and tell us what you see....
Are you running PHP as an Apache module, or as a CGI/binary?
Apache needs to have an "AddType" line in httpd.conf. If you're running PHP as mod_php, it'll need to "AddModule" and "LoadModule", also.
HTH,