I was trying to install Laravel by running the command
composer global require laravel/installer but it failed because
laravel/installer v2.0.x requires ext-zip.
Turns out it wasn’t installed on my system. To fix it, first find out your php version by running
php -v. Then use the php version number to install the missing extension like
sudo apt install php7.2-zip
This will also work for other extensions like