My suggestion is first to have the installer let the user select what components to install. Not all users need four PHP versions or Perl or whatever.
Second, some components can be reduced in size. For example, MySQL is installed with the include and lib directories containing header files and static or import libraries needed only for compiling software.
Well, maybe those files are included on purpose... I don't know.