Windows 10 WSL ZipArchive :: extractTo():权限被拒绝Laravel

时间:2016-10-14 01:54:55

标签: php linux laravel windows-10 windows-subsystem-for-linux

我试图在WSL上安装Laravel。到目前为止我安装了所有东西,但是当我运行laravel命令时,我从ZipArchive获得了一个Permission Denied。有办法解决这个问题吗?

我尝试的事情:

  • 目录是777 -r
  • 我的用户和www-data
  • 错误的目录的所有者
  • 制作文件777

    PHP Warning:  file_put_contents(/var/www/laravel_*.zip): failed to open    stream: Permission denied in /home/jeff/.composer/vendor/laravel/installer/src/NewCommand.php on line 132
    PHP Warning:  ZipArchive::extractTo(): Permission denied in /home/jeff/.composer/vendor/laravel/installer/src/NewCommand.php on line 150
    PHP Warning:  ZipArchive::close(): Invalid or uninitialized Zip object in /home/jeff/.composer/vendor/laravel/installer/src/NewCommand.php on line 152
    Composer could not find a composer.json file in /var/www
    To initialize a project, please create a composer.json file as described in the https://getcomposer.org/ "Getting Started" section
    Application ready! Build something amazing.
    

1 个答案:

答案 0 :(得分:0)

尝试将bash作为管理员运行。并使用composer create-project --prefer-dist laravel/laravel创建laravel项目而不是使用全局laravel installer

如果你想在Windows中开发,请尝试 Laragon