While this is an old post, I wanted to update this as it took me a few minutes to figure out myself.
in your nsd.tcl:
ns_section "ns/server/${servername}/modules"
ns_param php ${bindir}/libphp4.so
ns_section "ns/server/${servername}/module/php"
ns_param map .php
ns_param map .php3 ;#<-- in case you use old extension
There are more config options, but this should get you parsing.