I had the same problem on XAMPP for Windows10 when I try to install composer.
Unable to load dynamic library '/xampp/php/ext/php_bz2.dll'
Then follow this steps
- just open your current_xampp_containing_drive:\xampp(default_xampp_folder)\php\php.ini in texteditor (like notepad++)
- now just find - is the current_xampp_containing_drive:\xampp exist?
- if not then find the "extension_dir" and get the drive name(c,d or your desired drive) like.
extension_dir="F:\xampp731\php\ext" (here finded_drive_name_from_the_file is F)
- again replace with finded_drive_name_from_the_file:\xampp with current_xampp_containing_drive:\xampp and save.
- now again start the composer installation progress, i think your problem will be solved.