0

So, I am on Windows 10 and I installed the latest version of Xampp. Then installed Composer. Then I opened up command prompt in htdocs folder of my xampp and ran the following command:

composer create-project laravel/laravel myfirstapp

And I get the following error:

 Creating a "laravel/laravel" project at "./myfirstapp2"
Info from https://repo.packagist.org: #StandWithUkraine
Installing laravel/laravel (v9.5.0)
    Failed to download laravel/laravel from dist: The zip extension and unzip/7z commands are both missing, skipping.
The php.ini used by your command-line PHP is: C:\xampp\php\php.ini
    Now trying to download from source
  - Syncing laravel/laravel (v9.5.0) into cache
  - Installing laravel/laravel (v9.5.0): Cloning 091aa7d882 from cache
Created project in C:\xampp\htdocs\myfirstapp2
> @php -r "file_exists('.env') || copy('.env.example', '.env');"
Loading composer repositories with package information
Updating dependencies
Lock file operations: 107 installs, 0 updates, 0 removals
  - Locking brick/math (0.10.2)
  - Locking dflydev/dot-access-data (v3.0.2)
  - Locking doctrine/deprecations (v1.0.0)
  - Locking doctrine/inflector (2.0.6)
  - Locking doctrine/instantiator (2.0.0)
  - Locking doctrine/lexer (2.1.0)
  - Locking dragonmantank/cron-expression (v3.3.2)
  - Locking egulias/email-validator (3.2.5)
  - Locking fakerphp/faker (v1.21.0)
  - Locking filp/whoops (2.14.6)
  - Locking fruitcake/php-cors (v1.2.0)
  - Locking graham-campbell/result-type (v1.1.0)
  - Locking guzzlehttp/guzzle (7.5.0)
  - Locking guzzlehttp/promises (1.5.2)
  - Locking guzzlehttp/psr7 (2.4.3)
  - Locking hamcrest/hamcrest-php (v2.0.1)
  - Locking laravel/framework (v9.47.0)
  - Locking laravel/pint (v1.4.0)
  - Locking laravel/sail (v1.18.0)
  - Locking laravel/sanctum (v3.2.0)
  - Locking laravel/serializable-closure (v1.2.2)
  - Locking laravel/tinker (v2.8.0)
  - Locking league/commonmark (2.3.8)
  - Locking league/config (v1.2.0)
  - Locking league/flysystem (3.12.1)
  - Locking league/mime-type-detection (1.11.0)
  - Locking mockery/mockery (1.5.1)
  - Locking monolog/monolog (2.8.0)
  - Locking myclabs/deep-copy (1.11.0)
  - Locking nesbot/carbon (2.65.0)
  - Locking nette/schema (v1.2.3)
  - Locking nette/utils (v3.2.8)
  - Locking nikic/php-parser (v4.15.2)
  - Locking nunomaduro/collision (v6.4.0)
  - Locking nunomaduro/termwind (v1.15.0)
  - Locking phar-io/manifest (2.0.3)
  - Locking phar-io/version (3.2.1)
  - Locking phpoption/phpoption (1.9.0)
  - Locking phpunit/php-code-coverage (9.2.23)
  - Locking phpunit/php-file-iterator (3.0.6)
  - Locking phpunit/php-invoker (3.1.1)
  - Locking phpunit/php-text-template (2.0.4)
  - Locking phpunit/php-timer (5.0.3)
  - Locking phpunit/phpunit (9.5.28)
  - Locking psr/container (2.0.2)
  - Locking psr/event-dispatcher (1.0.0)
  - Locking psr/http-client (1.0.1)
  - Locking psr/http-factory (1.0.1)
  - Locking psr/http-message (1.0.1)
  - Locking psr/log (3.0.0)
  - Locking psr/simple-cache (3.0.0)
  - Locking psy/psysh (v0.11.10)
  - Locking ralouphie/getallheaders (3.0.3)
  - Locking ramsey/collection (2.0.0)
  - Locking ramsey/uuid (4.7.3)
  - Locking sebastian/cli-parser (1.0.1)
  - Locking sebastian/code-unit (1.0.8)
  - Locking sebastian/code-unit-reverse-lookup (2.0.3)
  - Locking sebastian/comparator (4.0.8)
  - Locking sebastian/complexity (2.0.2)
  - Locking sebastian/diff (4.0.4)
  - Locking sebastian/environment (5.1.4)
  - Locking sebastian/exporter (4.0.5)
  - Locking sebastian/global-state (5.0.5)
  - Locking sebastian/lines-of-code (1.0.3)
  - Locking sebastian/object-enumerator (4.0.4)
  - Locking sebastian/object-reflector (2.0.4)
  - Locking sebastian/recursion-context (4.0.4)
  - Locking sebastian/resource-operations (3.0.3)
  - Locking sebastian/type (3.2.0)
  - Locking sebastian/version (3.0.2)
  - Locking spatie/backtrace (1.2.1)
  - Locking spatie/flare-client-php (1.3.2)
  - Locking spatie/ignition (1.4.1)
  - Locking spatie/laravel-ignition (1.6.4)
  - Locking symfony/console (v6.2.3)
  - Locking symfony/css-selector (v6.2.3)
  - Locking symfony/deprecation-contracts (v3.2.0)
  - Locking symfony/error-handler (v6.2.3)
  - Locking symfony/event-dispatcher (v6.2.2)
  - Locking symfony/event-dispatcher-contracts (v3.2.0)
  - Locking symfony/finder (v6.2.3)
  - Locking symfony/http-foundation (v6.2.2)
  - Locking symfony/http-kernel (v6.2.4)
  - Locking symfony/mailer (v6.2.2)
  - Locking symfony/mime (v6.2.2)
  - Locking symfony/polyfill-ctype (v1.27.0)
  - Locking symfony/polyfill-intl-grapheme (v1.27.0)
  - Locking symfony/polyfill-intl-idn (v1.27.0)
  - Locking symfony/polyfill-intl-normalizer (v1.27.0)
  - Locking symfony/polyfill-mbstring (v1.27.0)
  - Locking symfony/polyfill-php72 (v1.27.0)
  - Locking symfony/polyfill-php80 (v1.27.0)
  - Locking symfony/polyfill-uuid (v1.27.0)
  - Locking symfony/process (v6.2.0)
  - Locking symfony/routing (v6.2.3)
  - Locking symfony/service-contracts (v3.2.0)
  - Locking symfony/string (v6.2.2)
  - Locking symfony/translation (v6.2.3)
  - Locking symfony/translation-contracts (v3.2.0)
  - Locking symfony/uid (v6.2.0)
  - Locking symfony/var-dumper (v6.2.3)
  - Locking theseer/tokenizer (1.2.1)
  - Locking tijsverkoyen/css-to-inline-styles (2.2.6)
  - Locking vlucas/phpdotenv (v5.5.0)
  - Locking voku/portable-ascii (2.0.1)
  - Locking webmozart/assert (1.11.0)
Writing lock file
Installing dependencies from lock file (including require-dev)
Package operations: 107 installs, 0 updates, 0 removals
    Failed to download doctrine/inflector from dist: The zip extension and unzip/7z commands are both missing, skipping.
The php.ini used by your command-line PHP is: C:\xampp\php\php.ini
    Now trying to download from source
  - Syncing doctrine/inflector (2.0.6) into cache
    Failed to download doctrine/deprecations from dist: The zip extension and unzip/7z commands are both missing, skipping.
The php.ini used by your command-line PHP is: C:\xampp\php\php.ini
    Now trying to download from source
  - Syncing doctrine/deprecations (v1.0.0) into cache
    Failed to download doctrine/lexer from dist: The zip extension and unzip/7z commands are both missing, skipping.
The php.ini used by your command-line PHP is: C:\xampp\php\php.ini
    Now trying to download from source
  - Syncing doctrine/lexer (2.1.0) into cache
    Failed to download symfony/polyfill-ctype from dist: The zip extension and unzip/7z commands are both missing, skipping.
The php.ini used by your command-line PHP is: C:\xampp\php\php.ini
    Now trying to download from source
  - Syncing symfony/polyfill-ctype (v1.27.0) into cache
    Failed to download webmozart/assert from dist: The zip extension and unzip/7z commands are both missing, skipping.
The php.ini used by your command-line PHP is: C:\xampp\php\php.ini
    Now trying to download from source
  - Syncing webmozart/assert (1.11.0) into cache
    Failed to download dragonmantank/cron-expression from dist: The zip extension and unzip/7z commands are both missing, skipping.
The php.ini used by your command-line PHP is: C:\xampp\php\php.ini
    Now trying to download from source
  - Syncing dragonmantank/cron-expression (v3.3.2) into cache
    Failed to download symfony/deprecation-contracts from dist: The zip extension and unzip/7z commands are both missing, skipping.
The php.ini used by your command-line PHP is: C:\xampp\php\php.ini
    Now trying to download from source
  - Syncing symfony/deprecation-contracts (v3.2.0) into cache
    Failed to download psr/container from dist: The zip extension and unzip/7z commands are both missing, skipping.
The php.ini used by your command-line PHP is: C:\xampp\php\php.ini
    Now trying to download from source
  - Syncing psr/container (2.0.2) into cache
    Failed to download fakerphp/faker from dist: The zip extension and unzip/7z commands are both missing, skipping.
The php.ini used by your command-line PHP is: C:\xampp\php\php.ini
    Now trying to download from source
  - Syncing fakerphp/faker (v1.21.0) into cache
    Failed to download symfony/polyfill-mbstring from dist: The zip extension and unzip/7z commands are both missing, skipping.
The php.ini used by your command-line PHP is: C:\xampp\php\php.ini
    Now trying to download from source
  - Syncing symfony/polyfill-mbstring (v1.27.0) into cache
    Failed to download symfony/http-foundation from dist: The zip extension and unzip/7z commands are both missing, skipping.
The php.ini used by your command-line PHP is: C:\xampp\php\php.ini
    Now trying to download from source
  - Syncing symfony/http-foundation (v6.2.2) into cache
    Failed to download fruitcake/php-cors from dist: The zip extension and unzip/7z commands are both missing, skipping.
The php.ini used by your command-line PHP is: C:\xampp\php\php.ini
    Now trying to download from source
  - Syncing fruitcake/php-cors (v1.2.0) into cache
    Failed to download psr/http-message from dist: The zip extension and unzip/7z commands are both missing, skipping.
The php.ini used by your command-line PHP is: C:\xampp\php\php.ini
    Now trying to download from source
  - Syncing psr/http-message (1.0.1) into cache
    Failed to download psr/http-client from dist: The zip extension and unzip/7z commands are both missing, skipping.
The php.ini used by your command-line PHP is: C:\xampp\php\php.ini
    Now trying to download from source
  - Syncing psr/http-client (1.0.1) into cache
    Failed to download ralouphie/getallheaders from dist: The zip extension and unzip/7z commands are both missing, skipping.
The php.ini used by your command-line PHP is: C:\xampp\php\php.ini
    Now trying to download from source
  - Syncing ralouphie/getallheaders (3.0.3) into cache
    Failed to download psr/http-factory from dist: The zip extension and unzip/7z commands are both missing, skipping.
The php.ini used by your command-line PHP is: C:\xampp\php\php.ini
    Now trying to download from source
  - Syncing psr/http-factory (1.0.1) into cache
    Failed to download guzzlehttp/psr7 from dist: The zip extension and unzip/7z commands are both missing, skipping.
The php.ini used by your command-line PHP is: C:\xampp\php\php.ini
    Now trying to download from source
  - Syncing guzzlehttp/psr7 (2.4.3) into cache
    Failed to download guzzlehttp/promises from dist: The zip extension and unzip/7z commands are both missing, skipping.
The php.ini used by your command-line PHP is: C:\xampp\php\php.ini
    Now trying to download from source
  - Syncing guzzlehttp/promises (1.5.2) into cache
    Failed to download guzzlehttp/guzzle from dist: The zip extension and unzip/7z commands are both missing, skipping.
The php.ini used by your command-line PHP is: C:\xampp\php\php.ini
    Now trying to download from source
  - Syncing guzzlehttp/guzzle (7.5.0) into cache
    Failed to download laravel/pint from dist: The zip extension and unzip/7z commands are both missing, skipping.
The php.ini used by your command-line PHP is: C:\xampp\php\php.ini
    Now trying to download from source
  - Syncing laravel/pint (v1.4.0) into cache
    Failed to download voku/portable-ascii from dist: The zip extension and unzip/7z commands are both missing, skipping.
The php.ini used by your command-line PHP is: C:\xampp\php\php.ini
    Now trying to download from source
  ....

And it keeps trying to sync everything that has failed to download in a never ending cycle.

What I understand is extensions are missing from php.ini? I can find only the sqlite extension in my php.ini file. How can I resolve this? Should I edit my php.ini file and add extensions? Which extensions to add for laravel 9 and php 8.2?

  • @Ken Lee that one is for Linux, I'm on Windows as I mentioned –  Jan 14 '23 at 13:49
  • @zanderwar I've clearly mentioned on top I'm using Xampp. –  Jan 14 '23 at 14:17
  • @zanderwar exactly, how to install them?? edit: forgot to write, for php 8.2 –  Jan 14 '23 at 14:21
  • @zanderwar I've seen that thread before, no zip.dll for php 8.2 unforunately. –  Jan 14 '23 at 14:25

1 Answers1

2

As stated here: https://www.php.net/manual/en/zip.installation.php#zip.installation.new.windows

As of PHP 8.2.0, php_zip.dll DLL must be enabled in php.ini. Previously, this extension was built-in.

You will need to manually enable this extension within your php.ini.

zanderwar
  • 3,440
  • 3
  • 28
  • 46
  • 1
    you mean like, extension=php_zip.dll? –  Jan 14 '23 at 14:29
  • 1
    correct, already in there? the php you use in command-line can be a different php from the one XAMPP is using, this could result in that change only working for one of those and lead to your composer installation issue if the CLI version does not also have it – zanderwar Jan 14 '23 at 14:33
  • 1
    My php.ini file had no extensions at all except one for sqlite. I copied everything from php-development.ini and pasted it in there along with extension=php_zip.dll Will this cause any issue? I don't know. But for now... finally after what seems like ages.. my first laravel app is finally created. Thankk youu so much –  Jan 14 '23 at 14:43
  • 1
    You're welcome, you catch more flies with honey! Happy to have helped – zanderwar Jan 14 '23 at 14:43