2023/02/10

[laravel][Windows env]composer 安裝套件時失敗

 "The zip extension and unzip/7z commands are both missing, skipping" in Windows during composer install laravel - Stack Overflow

我在看網路上的教學文章提及laravel sail是個好東西,所以我嘗試安裝好laravel之後在專案中下載

結果看到一堆錯誤

打了這個指令

composer require laravel/sail --dev

出現很多


- Syncing sebastian/complexity (2.0.2) into cache

    Failed to download sebastian/code-unit-reverse-lookup from dist: The zip extension and 

unzip/7z commands are both missing, skipping.

The php.ini used by your command-line PHP is: C:\php-8.2.2-Win32-vs16-x64\php.ini

    Now trying to download from source

其他的解法清一色是linux的解法,windows就沒有apt-get


stackoverflow裏頭提及解法是將php.ini的一行

extension=zip

將註解給取消即可