I have been using apache and php-cgi and it works well together but when I tried to use
mod_rewrite it stopped working and I got "Internal Server Error" result.
Apache error log showed "FastCGI: incomplete headers (0 bytes) received from server"
I think that mod_rewrite rules are ok because when I refer to some HTML file then it all works.
I've deleted "Action application/x-httpd-fastphp /fcgi-bin/php" and added your two lines
(I've used /fcgi-bin/php instead of /cgi-bin/php).
Apache responds with the same error - "Internal server error" in the browser and "Incomplete headers..." in the log.