you have to say to apache that foo.php
is a php document ;
so find in apache directory /conf
and edit httpd.conf
and delete the simbol # before:
AddType application/x-httpd-php
Beware are you usin php3 or php4 ?
if php choose
AddType application/x-httpd-php3
good luck ;-)