Question:
Laravel installation problem: Fix failed to download laravel/laravel from dist- Laravel (v10.2.6)

Problem:

I want to install laravel on my new laptop. Whenever I try to create new laravel project i get this message:

Creating a "laravel/laravel" project at "./test" Installing laravel/laravel (v10.2.6) 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:\php-8.2.11\php.ini Now trying to download from source


Syncing laravel/laravel (v10.2.6) into cache

  • Installing laravel/laravel (v10.2.6): Cloning 36047268f1 from cache Created project in C:\Users\jedro\Desktop\Programy\PHP/test @php -r "file_exists('.env') || copy('.env.example', '.env');" Loading composer repositories with package information Updating dependencies Your requirements could not be resolved to an installable set of packages.


Problem 1 - laravel/framework[v10.10.0, ..., v10.25.2] require league/flysystem ^3.8.0 -> satisfiable by league/flysystem[3.8.0, ..., 3.16.0]. - league/flysystem[3.3.0, ..., 3.14.0] require league/mime-type-detection ^1.0.0 -> satisfiable by league/mime-type-detection[1.0.0, ..., 1.13.0]. - league/flysystem[3.15.0, ..., 3.16.0] require league/flysystem-local ^3.0.0 -> satisfiable by league/flysystem-local[3.15.0, 3.16.0]. - league/mime-type-detection[1.0.0, ..., 1.3.0] require php ^7.2 -> your php version (8.2.11) does not satisfy that requirement. - league/mime-type-detection[1.4.0, ..., 1.13.0] require ext-fileinfo * -> it is missing from your system. Install or enable PHP's fileinfo extension. - league/flysystem-local[3.15.0, ..., 3.16.0] require ext-fileinfo * -> it is missing from your system. Install or enable PHP's fileinfo extension. - Root composer.json requires laravel/framework ^10.10 -> satisfiable by laravel/framework[v10.10.0, ..., v10.25.2].


To enable extensions, verify that they are enabled in your .ini files: - C:\php-8.2.11\php.ini You can also run php --ini in a terminal to see which files are used by PHP in CLI mode. Alternatively, you can run Composer with --ignore-platform-req=ext-fileinfo to temporarily ignore these required extensions.


The project is created but I'm not sure if it works properly. How do I fix it? I tried reinstalling PHP and Composer but it didn't fix it. When I try php --ini I get this message:


Configuration File (php.ini) Path: Loaded Configuration File: C:\php-8.2.11\php.ini Scan for additional .ini files in: (none) Additional .ini files parsed: (none)


Solution:

Just uncomment ;extension=zip line in your php.ini file. and also ;extension=fileinfo.

Just like


extension=zip

extension=fileinfo


Even after this if you get error for another extension then do the same with that also if it present in your php.ini file.


Suggested blogs:

>Build a minimal ASP.Net Core API with Android Studio for Mac

>Build an Electron application from scratch

>Build Progressive Web Apps with Angular

>Building a web application with Angular and Firebase

>Building Web API using ASP.NET (C#)

>Built Web API using ASP.NET (C#)


Ritu Singh

Ritu Singh

Submit
0 Answers