Yes, if you have php installed as a cgi program in begin the PHP code with #!/usr/local/bin/php ... but it also works to do this:
<!--#include virtual="whatever.php" -->
... if you have PHP installed in a normal (module) scenario. This is one way around the problem of having many links to a legacy URL that you want to switch over to PHP functionality.