Search code examples
phpsymfonyvagrantvirtualboxhomestead

No input files specified - symfony app set up with homestead


I tried to use homestead to iset up Symfony using instruction here. Everything seemed to run correctly in git bash, but after php bin/console server:start, I get "No input files specified" when I go to localhost:8000 or http://127.0.0.1:8000 or symfony-demo.test. I have searched around and tried different approaches for the past 6 hours, but still can't get it work. I'm quite new to virtual machine and vagrant, and complete newbie to Symfony so any help would be highly appreciated!
Here is my Homestead.yaml file:

folders:
    - map: C:\php-apps
      to: /home/vagrant/code

sites:
    # - map: homestead.test
    #   to: /home/vagrant/code/homestead/public
    - map: symfony-demo.test
      to: /home/vagrant/code/symfony_demo/web
      type: symfony

Here is the host file:

#192.168.10.10 homestead.test

192.168.10.10 symfony-demo.test

Here is latest commands I ran in git bash:

vagrant@homestead:~$ ls
code
vagrant@homestead:~$ cd code/
vagrant@homestead:~/code$ cd symfony_demo/
vagrant@homestead:~/code/symfony_demo$ ls
symfony  symfony-demo
vagrant@homestead:~/code/symfony_demo$ cd symfony-demo/
vagrant@homestead:~/code/symfony_demo/symfony-demo$ ls
app  bin  composer.json  composer.lock  phpunit.xml.dist  README.md  src  tests  var  vendor  web
vagrant@homestead:~/code/symfony_demo/symfony-demo$ php bin/console server:start


 [OK] Server listening on http://127.0.0.1:8000                                                                         


vagrant@homestead:~/code/symfony_demo/symfony-demo$

I tested Laravel before and it worked fine, though http://127.0.0.1:8000 was also showing laravel after started the symfony server in symfony-demo, so I commented out Laravel site in host file and Homestead.yaml and ran vagrant --provision. Afterwards when I went back to symfony-demo directory and launched the server again, everything starts to show "No input files specified".


Solution

  • I have figured it out so I want to post my solution here just in case someone else ran into the same issues as me. So I'm on a windows 10, before my own config files, please do read careful through these 3 resources:
    Using homestead to install Symfony on various version documentation by Symfony
    Installing Symfony 3 with vagrant and homestead by Sanket Patel
    Set up homestead on windows by JBorbón

    Here is what I did:

    1. Create a homestead folder on my C drive.
    2. Install symfony installer on C drive and move it into the homestead folder above.
    3. Create my project inside of homestead folder above (my project is called autotrader).
    4. Download vagrant, virtual box and set up homestead according to their documentation. I set up a directory called homesteadserver where I cloned homestead in.
    5. Configure my Homestead.yaml file as below:

              folders:
                  # - map: ~/code
                  #   to: /home/vagrant/code
                  - map: C:\homestead
                    to: /home/vagrant/homestead
      
              sites:
                  # - map: homestead.test
                  #   to: /home/vagrant/code/public
                  - map: autotrader.test
                    to: /home/vagrant/homestead/autotrader/web
                    type: symfony
      
    6. Configure my host file as below:

      192.168.10.10 autotrader.test
      
    7. Go to my homestead server and vagrant up and provision.