make php internal deps based on package basename (php, php52, php54)

cherry-picked d87d42cb647475a50c512f674ac5902773c42468