1

I am trying to create new Laravel application.

I have installed XAMPP and Composer. With Composer ( composer global require laravel/installer ) I have installed Laravel.

But when I try to use laravel new firstProject command to create new command the instalation throws two errors.

I am using Windows 10 if that helps.

 [RuntimeException]
  The archive may contain identical file names with different capitalization (which fails on case insensitive filesys
  tems): ZipArchive::extractTo(C:\Users\User1\Desktop\PHP/vendor/composer/374ddf59/laravel-laravel-8e55104\public/rob
  ots.txt): Failed to open stream: Permission denied

  [ErrorException]
  ZipArchive::extractTo(C:\Users\User1\Desktop\PHP/vendor/composer/374ddf59/laravel-laravel-8e55104\public/robots.txt
  ): Failed to open stream: Permission denied

I have tried:

  1. Reinstalling and updating composer
  2. Reinstalling and updating Laravel
  3. Changing folder where I want to create my project
  4. Using the composer create-project laravel/laravel blog command to create new project through composer still the same errors as above

FIXED: I had to disable antivirus and add Laravel as exception

Filip Studený
  • 470
  • 1
  • 3
  • 11

3 Answers3

1

Read with understanding:

Failed to open stream: Permission denied.


This means that your command line have no access to read or write in current directory. You have to change directory permissions and it should work.

change permissions on windows

change permissions on mac

Adrian Zavis
  • 233
  • 2
  • 11
  • 2
    Please add some explanation to your answer such that others can learn from it – Nico Haase Jul 19 '21 at 11:53
  • I actually am logged in as Administrator, I have full control over the whole system. but I can only create Laravel project in the system32 folder (Just discovered). Don't know why tho. – Filip Studený Jul 19 '21 at 13:21
1

I had the same problem (Win10).

In my case, my antivirus (Avast) was denying access to composer, but I did not know because I had set Avast to silent mode, so it just denied permission without asking me.

Also, Avast quaranteened an important server.php file so artisan server would stop as soon as I tried loading a page. So I had to restore and allow that file too.

0

i have the solution.

You only need delete in c:\program file\7-Zip,

after you need, reinstall this software. 7-zip, You need download this software of webpage author.

after execute

laravel new your_app

and ready.

  • But here [ZipArchive](https://www.php.net/manual/de/class.ziparchive.php) is used for extraction, not 7zip. This does not provide an answer to the question. Once you have sufficient [reputation](https://stackoverflow.com/help/whats-reputation) you will be able to [comment on any post](https://stackoverflow.com/help/privileges/comment); instead, [provide answers that don't require clarification from the asker](https://meta.stackexchange.com/questions/214173/why-do-i-need-50-reputation-to-comment-what-can-i-do-instead). - [From Review](/review/late-answers/31684469) – cachius May 08 '22 at 18:16