"the path to the interpreter" is /usr/bin and the interpreter in this case is php. The hash bang tells the operating system what program the script requires to run. See the Wiki page.
The script can be in any folder but usually placed in the cgi-bin folder. It doesn't matter if it's a perl or php script.