创建新的laravel项目时如何解决以下错误

时间:2020-04-16 17:47:51

标签: laravel homestead

我是Homestead和laravel的新手,我正在尝试安装Homestead并启动新的laravel proeject,我按照以下链接https://www.youtube.com/watch?v=Il08--droNI中的步骤进行操作,看来我成功安装了Homestead之后便开始了 无所适从 并使用以下命令在我的Homestead文件夹中安装了laravel 作曲家全球需要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.

2 个答案:

答案 0 :(得分:1)

或在带有 IIS 的 Windows 中

extension=php_fileinfo.dll

答案 1 :(得分:0)

在php.ini文件中,取消注释以下行extension = fileinfo