I solved it. .htaccess to the rescue! If anyone else (who is a noob like me) cares to know, just specify that you need files with your custom php extension processed by PHP by adding this line to .htaccess:
AddType application/x-httpd-php .foo .php .phtml .whatever-else
where .foo is your custom extension.
"...better agony than dullness, better an ocean storm than a placid pond..."