Add extension to be interpreted by PHP

I added this to my .htaccess file:

AddHandler fcgid-script .test

And crated a test.test file with the contents;

<?php echo "test"; ?>

This results in an internal server error and this message in the error log:

[Thu Apr 16 14:12:57.631287 2015] [fcgid:warn] [pid 2646] (104)Connection reset by peer: [client xxxx:53595] mod_fcgid: error reading data from FastCGI server
[Thu Apr 16 14:12:57.631402 2015] [core:error] [pid 2646] [client xxxx:53595] End of script output before headers: test.test

What am I doing wrong? I tried using different handler namees like x-httpd-php or x-httpd-php5 but that doesn’t do anything at all.