Till has posted a guide for testing a web application with the latest and greatest versions of Ngnix and PHP (PHP6!) running as a FastCGI.
So, every once in a while I find myself in need of trying out newer, maybe, not-yet-released features in PHP. For example, recently, I wanted to test RoundCube PHP6 '" this is how I did it. On a side note, the same setup would also work for testing code with previous versions of PHP.
Everything's there - from the configure commands to the settings that'll need changing to the commands you'll need to use to get things started up right.