PHP: Fix the multi-install logic for extension and remove legacy code.