0

Creating a web project using Xampp and Composer.

Whenever I try to run the Composer command:

C:\> composer create-project laravel/laravel <project name>

It gives me a diagnostic message saying that zip extension and unzip/7s commands are missing. The command does create a project but then it doesn't connect with SQL in XAMPP.

Due to the zip extension and unzip/7s commands missing it doesn't install required packages to make the project run.

I have tried uninstalling and reinstalling Composer but the error persists. I am using php 8.2

  • If you're on a Debian-ish OS, `sudo apt install unzip` – Alex Howansky Jan 07 '23 at 19:17
  • im using windows – Muhammad Abdullah Jan 07 '23 at 19:31
  • @MuhammadAbdullah, welcome to Stackoverflow. You can install **7z (7-Zip)** on Windows, give it a try: https://www.7-zip.org/download.html (pick a version suitable for your system). Also please take the time to [edit] your question adding the error message(s) as text, not an image. This is required on Stackoverflow, let me know if you'd like to have more information why that is (I'm sure you can already imagine, but just in case, I can share some links if you're curious, just let me know then). – hakre Jan 08 '23 at 02:22
  • 1
    i do curious what is your exact error message. as far as i can remember xampp should already bundled with php's zip extension. can you tell us: 1) the exact error message; 2) xampp version; 3) php version; 4) is `extension=php_zip.dll` in `php.ini` (on xampp control panel click config then `php.ini`); 5) check whether `php_zip.dll` exists in folder where xampp installed `xampp\php\ext`. – Bagus Tesa Jan 08 '23 at 02:35
  • 1
    thanks, it was related to php.ini. The zip file was not activated there, now its working – Muhammad Abdullah Jan 08 '23 at 08:57
  • @MuhammadAbdullah: Thanks for the feedback. Could you tell which PHP version you're using? Perhaps PHP 8.2? Asking because in a related Q&A we got this answer recently: https://stackoverflow.com/a/75072544/367456 (please [edit] in the PHP version to your question as well, thanks!). – hakre Jan 10 '23 at 20:06
  • And please consider to answer your question, that is much better than commenting, as your solution is much more visible and you can accept it later to mark the question as "solved" (answered). – hakre Jan 10 '23 at 20:08
  • Maybe this can help https://stackoverflow.com/a/75072971/15770919 – OBrien Evance Mar 27 '23 at 10:52

1 Answers1

0

Referring to the comments above, the problem was in the php.ini file. The zip extension was disabled, you need to enable the zip extension in php.ini.

  • It would be great if you could add a _little_ bit more context: the PHP version you have in use. Try `composer diagnose` (it shows it) and/or `php -v`. Thanks for taking care. – hakre Jan 12 '23 at 16:05
  • Please set your answer as accepted if it solved your problem – Csisanyi Jan 13 '23 at 15:57