【发布时间】:2020-07-30 01:44:31
【问题描述】:
我是宅基地和 laravel 的新手,我正在尝试安装宅基地并开始新的 laravel 项目,我按照以下链接中的步骤操作,https://www.youtube.com/watch?v=Il08--droNI,看来我成功安装宅基地然后我开始了 变态 并使用以下命令在我的 Homestead 文件夹中安装 laravel composer global 需要 laravel/installer 现在我正在尝试使用以下命令启动新项目 laravel 新博客 但它给了我以下错误
Crafting application...
PHP Warning: file_put_contents(/home/vagrant/code/laravel_816486aaffc1239c550dccbdbf28f281.zip): failed to open stream: Permission denied in /home/vagrant/.composer/vendor/laravel/installer/src/NewCommand.php on line 147
Warning: file_put_contents(/home/vagrant/code/laravel_816486aaffc1239c550dccbdbf28f281.zip): failed to open stream: Permission denied in /home/vagrant/.composer/vendor/laravel/installer/src/NewCommand.php on line 147
PHP Warning: ZipArchive::extractTo(): Permission denied in /home/vagrant/.composer/vendor/laravel/installer/src/NewCommand.php on line 169
Warning: ZipArchive::extractTo(): Permission denied in /home/vagrant/.composer/vendor/laravel/installer/src/NewCommand.php on line 169
PHP Warning: ZipArchive::close(): Invalid or uninitialized Zip object in /home/vagrant/.composer/vendor/laravel/installer/src/NewCommand.php on line 171
Warning: ZipArchive::close(): Invalid or uninitialized Zip object in /home/vagrant/.composer/vendor/laravel/installer/src/NewCommand.php on line 171
You should verify that the "storage" and "bootstrap/cache" directories are writable.
In Process.php line 332:
The provided cwd "/home/vagrant/code/myproject" does not exist.
new [--dev] [--auth] [-f|--force] [--] [<name>]
vagrant@homestead:~/code$ ^C
这是我的 .yaml 文件
---
ip: "192.168.10.10"
memory: 2048
cpus: 2
provider: virtualbox
folders:
- map: C:\Users\hit-ham\laravel-apps
to: /home/vagrant/code
type: "nfs"
sites:
- map: myproject.test
to: /home/vagrant/code/myproject/public
databases:
- homestead
features:
- mariadb: false
- ohmyzsh: false
- webdriver: false
# ports:
# - send: 50000
# to: 5000
# - send: 7777
# to: 777
# protocol: udp
我的 Homestead 文件夹在 users/myname 中
编辑:我试图删除所有内容并设置新窗口,并从头开始,安装 vagrant , virtual box ,composer,但我现在有新错误
Crafting application...
Loading composer repositories with package information
Installing dependencies (including require-dev) from lock file
Your requirements could not be resolved to an installable set of packages.
Problem 1
- Installation request for league/flysystem 1.0.67 -> satisfiable by league/flysystem[1.0.67].
- league/flysystem 1.0.67 requires ext-fileinfo * -> the requested PHP extension fileinfo is missing from your system.
Problem 2
- league/flysystem 1.0.67 requires ext-fileinfo * -> the requested PHP extension fileinfo is missing from your system.
- laravel/framework v7.6.2 requires league/flysystem ^1.0.8 -> satisfiable by league/flysystem[1.0.67].
- Installation request for laravel/framework v7.6.2 -> satisfiable by laravel/framework[v7.6.2].
To enable extensions, verify that they are enabled in your .ini files:
- C:\php7\php.ini
You can also run `php --ini` inside terminal to see which files are used by PHP in CLI mode.
【问题讨论】:
-
好像是说您没有写入该文件夹的权限。我过去为创建一个新项目所做的就是在我的 VH 中进行。如果您将
cd放入您的Homestead目录并执行vagrant ssh,会发生什么情况?如果您可以登录,请发送ls以查看那里有哪些文件夹。如果你能找到/home/vagrant/codecd 进去。进入后,THEN 试试laravel new blog。