I'm going to close this because I don't think there is any bug in Emacs
here; but feel free to keep discussing it here if you like.
(If "php" is commonly installed as something other than "php", perhaps
flymake.el needs a flymake-php-program option, similar to the existing
flymake-xml-program. Likewise for "perl" and "texify".)