在流浪汉和宅基地中添加phpmyadmin时出现问题

3yhwsihp  于 2022-11-09  发布在  PHP
关注(0)|答案(1)|浏览(133)

我试着安装了几次phpmyadmin,但是失败了。我一直在修改宅基地.yaml,但是当我尝试命令vagrant reload --provision时,vagrant总是给我一个错误。Vagrant对我来说是一个普通的laravl项目。
homestead.yaml

---

folders:
  - map: E:\projects
    to: /home/vagrant/code
  - map: E:\projects\phpmyadmin
    to: /home/vagrant/code/phpmyadmin

sites:
  - map: dev-cms.com
    to: /home/vagrant/code/new-blog/public
  - map: phpmyadmin.test
      to: /home/vagrant/code/new-blog/phpmyadmin

databases:
  - homestead

键入vagrant reload --provision时出现不定错误

C:/HashiCorp/Vagrant/embedded/mingw64/lib/ruby/2.7.0/psych.rb:456:in `parse': (<unknown>): mapping values are not allowed in this context at line 22 column 9 (Psych::SyntaxError)
        from C:/HashiCorp/Vagrant/embedded/mingw64/lib/ruby/2.7.0/psych.rb:456:in `parse_stream'
        from C:/HashiCorp/Vagrant/embedded/mingw64/lib/ruby/2.7.0/psych.rb:390:in `parse'
        from C:/HashiCorp/Vagrant/embedded/mingw64/lib/ruby/2.7.0/psych.rb:277:in `load'
        from C:/Users/User/Homestead/Vagrantfile:29:in `block in <top (required)>'
        from C:/HashiCorp/Vagrant/embedded/gems/2.2.19/gems/vagrant-2.2.19/lib/vagrant/config/v2/loader.rb:37:in `load'
        from C:/HashiCorp/Vagrant/embedded/gems/2.2.19/gems/vagrant-2.2.19/lib/vagrant/config/loader.rb:126:in `block (2 levels) in load'
        from C:/HashiCorp/Vagrant/embedded/gems/2.2.19/gems/vagrant-2.2.19/lib/vagrant/config/loader.rb:119:in `each'
        from C:/HashiCorp/Vagrant/embedded/gems/2.2.19/gems/vagrant-2.2.19/lib/vagrant/config/loader.rb:119:in `block in load'
        from C:/HashiCorp/Vagrant/embedded/gems/2.2.19/gems/vagrant-2.2.19/lib/vagrant/config/loader.rb:116:in `each'
        from C:/HashiCorp/Vagrant/embedded/gems/2.2.19/gems/vagrant-2.2.19/lib/vagrant/config/loader.rb:116:in `load'
        from C:/HashiCorp/Vagrant/embedded/gems/2.2.19/gems/vagrant-2.2.19/lib/vagrant/vagrantfile.rb:29:in `initialize'
        from C:/HashiCorp/Vagrant/embedded/gems/2.2.19/gems/vagrant-2.2.19/lib/vagrant/environment.rb:793:in `new'
        from C:/HashiCorp/Vagrant/embedded/gems/2.2.19/gems/vagrant-2.2.19/lib/vagrant/environment.rb:793:in `vagrantfile'
        from C:/HashiCorp/Vagrant/embedded/gems/2.2.19/gems/vagrant-2.2.19/lib/vagrant/environment.rb:974:in `process_configured_plugins'
        from C:/HashiCorp/Vagrant/embedded/gems/2.2.19/gems/vagrant-2.2.19/lib/vagrant/environment.rb:178:in `initialize'
        from C:/HashiCorp/Vagrant/embedded/gems/2.2.19/gems/vagrant-2.2.19/bin/vagrant:194:in `new'
        from C:/HashiCorp/Vagrant/embedded/gems/2.2.19/gems/vagrant-2.2.19/bin/vagrant:194:in `<main>'

宿主Windows文件

192.168.56.56 dev-cms.com
127.0.0.1 phpmyadmin.test
bakd9h0s

bakd9h0s1#

问题中提供的yaml有一些缩进问题,您可以查看yaml lint来验证您的yaml文件。
以下一项将有效

--- 

databases: 
  - homestead
folders: 
  - map: "E:\\projects"
    to: /home/vagrant/code
  - map: "E:\\projects\\phpmyadmin"
    to: /home/vagrant/code/phpmyadmin
sites: 
  - map: dev-cms.com
    to: /home/vagrant/code/new-blog/public
  - map: phpmyadmin.test
    to: /home/vagrant/code/new-blog/phpmyadmin

注:

  • 第1行额外空格
  • 第二个站点的缩进错误to: /home/vagrant/code/new-blog/phpmyadmin

相关问题