【问题标题】:Laravel installer throws error when creating new projectLaravel 安装程序在创建新项目时抛出错误
【发布时间】:2021-09-27 00:56:56
【问题描述】:

我正在尝试创建新的 Laravel 应用程序。

我已经安装了 XAMPP 和 Composer。 使用 Composer (composer global require laravel/installer) 我已经安装了 Laravel。

但是当我尝试使用laravel new firstProject 命令创建新命令时,安装会引发两个错误。

如果有帮助,我正在使用 Windows 10。

 [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

我试过了:

  1. 重新安装和更新作曲家
  2. 重新安装和更新 Laravel
  3. 更改要在其中创建项目的文件夹
  4. 使用composer create-project laravel/laravel blog命令通过composer新建项目还是和上面一样的错误

【问题讨论】:

    标签: php laravel laravel-5 error-handling composer-php


    【解决方案1】:

    带着理解去阅读:

    Failed to open stream: Permission denied.


    这意味着您的命令行无权读取或写入当前目录。您必须更改目录权限,它应该可以工作。

    change permissions on windows

    change permissions on mac

    【讨论】:

    • 请在您的答案中添加一些解释,以便其他人可以从中学习
    • 我实际上是以管理员身份登录的,我可以完全控制整个系统。但我只能在 system32 文件夹中创建 Laravel 项目(刚刚发现)。不知道为什么。
    猜你喜欢
    • 2023-04-01
    • 2016-08-27
    • 1970-01-01
    • 1970-01-01
    • 2020-02-09
    • 2022-06-15
    • 2015-06-08
    • 2019-02-23
    • 2014-11-12
    相关资源
    最近更新 更多