我试图在WSL上安装Laravel。到目前为止我安装了所有东西,但是当我运行laravel命令时,我从ZipArchive获得了一个Permission Denied。有办法解决这个问题吗?
我尝试的事情:
制作文件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.
答案 0 :(得分:0)
尝试将bash
作为管理员运行。并使用composer create-project --prefer-dist laravel/laravel
创建laravel项目而不是使用全局laravel installer
。
如果你想在Windows中开发,请尝试 Laragon 。