duanshang7007
duanshang7007
2016-12-09 17:31

打开流浪汉服务器 - Laravel 5.3

已采纳

Yesterday I started to learn Laravel and set up server using Vagrant. Everything was fine. example.dev was working and even managed to make some html/css progress. Then my PC was turned off.

Today I came back home and wanted to re-start where I left but when I entered example.dev it said "Not found!". I went in git bash console, cd to vagrant and did command vagrant up. Machine was booted correctly and started working, but example.dev is still offline.

How to fix this?

I'm using Laravel 5.3 + Vagrant + VBox.

  • 点赞
  • 写回答
  • 关注问题
  • 收藏
  • 复制链接分享
  • 邀请回答

2条回答

  • dou4381 dou4381 5年前

    If webpage gives you "No input file specified." this means your project directory is not properly mounted to homestead. first check your homestead.yaml file so it is properly formatted and has both:

    folders:
    - map: C:/your_project_root_directory
      to: /home/vagrant/Code
    

    and also there should be a right settings for your nginx virtual host section

    sites:
    - map: homestead.app
      to: /home/vagrant/Code/public
    

    If your directories are different adjust accordingly.

    After this settings checking you need to vagrant up --provision It'll update your vagrant box configuration as you've specified in Homestead.yaml

    this file usually placed in ~/.homestead/Homestead.yaml

    ~ means home directory on windows it is C:\Users\Your_UserName\

    after you'll provision your box make vagrant halt again and vagrant up after this you can check if your development box accessible. To ensure you've set up path mappings correctly you can log in to your box via ssh and check contents of /home/vagrant and subdirectories

    Note: yaml files doesnot allow tab spaces! only usuall spaces edit it in editor like Notepad++ which could show you unprintable characters so you'll not break your yaml file.

    点赞 评论 复制链接分享
  • dongzhangnong2063 dongzhangnong2063 5年前

    I faced the same problem, and in my case I fixed by

      vagrant provision
    

    And then

     vagrant up
    
    点赞 评论 复制链接分享