Homestead gives error: No input file specified. on Windows 10 - laravel

I'm running Homestead under Windows 10 using VirtualBox. For some reason, no matter what I try, I get this error:
I only found a single other question similar to my issues, and the resolution there resulted in an error when running vagrant up.
No input file specified.
My homestead.yaml file looked like this:
ip: "192.168.10.10"
memory: 2048
cpus: 2
provider: virtualbox
folders:
- map: D:/code
to: /home/code
sites:
- map: homestead.test
to: /home/code/test/public
sites:
- map: info.test
to: /home/code/info/public
sites:
- map: food.test
to: /home/code/food/public
databases:
- homestead
- food
- info
features:
- mysql: true
- mariadb: false
- postgresql: false
- ohmyzsh: false
- webdriver: f
My hosts file is:
192.168.10.10 homestead.test
192.168.10.10 info.test
192.168.10.10 food.test
The folder mappings appear to be working. If I browse D:/code from the host I can see the Laravel
install under D:/code/test. I if put a file there on the host, it's visible from vagrant ssh.
What am I missing?

Try updating your Homestead.yaml file to this:
sites:
- map: homestead.test
to: /home/code/test/public
- map: info.test
to: /home/code/info/public
- map: food.test
to: /home/code/food/public
Maybe specifying "sites" multiple times is what's breaking it.

Have you tried logging in to your box with vagrant ssh and then doing flip to toggle between nginx and Apache?
See https://laravel.com/docs/8.x/homestead#web-servers

Related

Homestead not loading web page

I have searched and tried everywhere for something that might fix this but whenever I have a new homestead code folder, it doesn't work when I use vagrant and virtualbox. I have checked my hosts files and every file. No error shows up but it clearly doesn't work. I have also enabled virtualization on my CPU. Below is my current homestead.yaml file
---
ip: "192.168.10.10"
memory: 2048
cpus: 2
provider: virtualbox
folders:
- map: C:/Laravel/code
to: /home/vagrant/code
sites:
- map: homestead.test
to: /home/vagrant/code/homestead/public
- map: homestead1.test
to: /home/vagrant/code/homestead1/public
- map: coursework.test
to: /home/vagrant/code/coursework/public
databases:
- homestead
features:
- mariadb: false
- ohmyzsh: false
- webdriver: false
# ports:
# - send: 50000
# to: 5000
# - send: 7777
# to: 777
# protocol: udp
I am trying to just get coursework.test to work but I'm sure its wrong on both of them
Your problem is in the way you use your slashes.
- map: C:/Laravel/code
has to be
- map: C:\Laravel\code
Another problem you will be walking against is that you do not have a database.
Enable mariadb or something else in your features tab

No input file selected using Homestead

I'm on Windows and i'm trying to work with Laravel Homestead.
Actually I have the problem of "No input file selected" seems like URL it's not correctly.
My real PATH is this:
C:\Users\Lluis\Projects Where I have my projects
And D:\Homestead_Projects where I want to copy it when make vagrant up.
My homestead.yaml file looks like here:
---
ip: "192.168.10.10"
memory: 2048
cpus: 1
provider: virtualbox
authorize: c:/Users/Lluis/.ssh/id_rsa.pub
keys:
- c:/Users/Lluis/.ssh/id_rsa
folders:
- map: d:/Homestead_Projects
to: c:/Users/Lluis/Projects
sites:
- map: homestead.app
to: c:/Users/Lluis/Projects/puvik/public
databases:
- homestead
Anyone see the error? Thanks!
Edit Now file looks like here
---
ip: "192.168.10.10"
memory: 2048
cpus: 1
provider: virtualbox
authorize: ~/.ssh/id_rsa.pub
keys:
- ~/.ssh/id_rsa
folders:
- map: ~/Projects
to: /home/vagrant/Projects
sites:
- map: homestead.test
to: /home/vagrant/Projects/puvik/public
databases:
- homestead
Your folder mapping is a little bit off.
Try this:
folders:
- map: c:/Users/Lluis/Projects
to: /home/vagrant/projects
sites:
- map: homestead.test
to: /home/vagrant/projects/puvik/public
Make sure you don't use .app anymore Chrome doesn't like it. use .test
On my case I had to do a vagrant provision to reload the VM
`vagrant provision`

No input file specified on vagrant vm

First off: I'm new to using Laravel. I got the homestead VM up and running with Vagrant. I checked my Homestead.yaml file and it checks out, did the additions to the hosts file as well, and created my blog according to the video tutorials on the VM.
When I run the command "php artisan serve" and try the address it returns, I get an error saying "No input file specified".
Anyone have a fix for this?
ip: "192.168.10.10"
memory: 2048
cpus: 1
provider: virtualbox
authorize: ~/.ssh/id_rsa.pub
keys:
- ~/.ssh/id_rsa
folders:
- map: /Users/JeromePapalie/LaravelCode
to: /home/vagrant/Code/Laravel
sites:
- map: homestead.app
to: /home/vagrant/Code/Laravel/public
databases:
- homestead
First, you need to check the folder structure.
This is my folder structure.
Here my Homestead.yaml file
---
ip: "192.168.10.10"
memory: 2048
cpus: 1
provider: virtualbox
authorize: /Users/kelvin/.ssh/kevin.pub
keys:
- ~/.ssh/kevin
folders:
- map: ~/Documents/Work/kevindev/Code
to: /home/vagrant/Code
sites:
- map: homestead.app
to: /home/vagrant/Code/Laravel/public
databases:
- homestead
# blackfire:
# - id: foo
# token: bar
# client-id: foo
# client-token: bar
# ports:
# - send: 50000
# to: 5000
# - send: 7777
# to: 777
# protocol: udp
Hope, you already generated ssh key file in your target folder something like this.
And then, open your host vim /etc/hosts and add your homestead.app host
Finally, go to your Homestead folder and type vagrant up command.
That's is.

Cannot get Homestead and Laravel working

I am getting 403 Forbidden when going to homestead.app but it works with homestead.app/public
---
ip: "192.168.10.10"
memory: 2048
cpus: 1
provider: virtualbox
authorize: ~/.ssh/id_rsa.pub
keys:
- ~/.ssh/id_rsa
folders:
- map: ~/Desktop
to: /home/vagrant/Desktop
type: "nfs"
sites:
- map: valiant.dev
to: /home/vagrant/Desktop/Laravel
databases:
- homestead
Any help with this would be greatly appreciated, I am about to give up and go back to codeigniter.
Update your homestead.yaml file on .homestead folder to this
ip: "192.168.10.10"
memory: 2048
cpus: 1
provider: virtualbox
authorize: ~/.ssh/id_rsa.pub
keys:
- ~/.ssh/id_rsa
folders:
- map: ~/Desktop/Code
to: /home/vagrant/Code
sites:
- map: valiant.app
to: /home/vagrant/Code/public
databases:
- homestead
Mapping folders syncing
folders:
- map: ~/Desktop/Code
to: /home/vagrant/Code
This means that we are going to sync the Desktop/Code folder and /home/vagrant/Code folder so that files are updated on both folders.
Mapping website
sites:
- map: valiant.app
to: /home/vagrant/Code/public
This means whenever you are going to hit valiant.app folder it will check /home/vagrant/Code/public path
Updating Hosts
When you have successfully configured the above one, do vim /etc/hosts and add the following line to the file
192.168.10.10 valiant.dev
Reloading Vagrant
Once you have done all the above mentioned tasks, cd into the Homestead directory on home folder and do the following
vagrant reload --provision
above command will create(if doesn't exist already) on vagrant machine and map them according. Now do
vagrant up
That should get you working.

Laravel 5.2 - Homestead same site loading for every domain

For whatever reason I cannot get multiple sites to work with Homestead. Every new site added, returns the same site when I visit it in the browser
I have tried every "solution" I have come across here on stack as well as on larvel.io. None of them solve the problem. Any help would be greatly appreciated.
Below are the contents of both my .yaml file and my hosts file.
Local Directory Structure:
Root directory = WWW
project1 = WWW/project1
project2 = WWW/project2
Homestead.yaml:
---
ip: "192.168.10.10"
memory: 2048
cpus: 1
provider: virtualbox
authorize: ~/.ssh/id_rsa.pub
keys:
- ~/.ssh/id_rsa
folders:
- map: ~/WWW
to: /home/vagrant/Code
sites:
- map: /project1.app
to: /home/vagrant/Code/project1/public
- map: /project2.dev
to: /home/vagrant/Code/project2/public
databases:
- project1_db
- project2_db
variables:
- key: 'APP_ENV'
value: 'local'
- key: 'APP_DEBUG'
value: 'true'
# blackfire:
# - id: foo
# token: bar
# client-id: foo
# client-token: bar
# ports:
# - send: 93000
# to: 9300
# - send: 7777
# to: 777
# protocol: ump
/etc/hosts file:
##
# Host Database
#
# localhost is used to configure the loopback interface
# when the system is booting. Do not change this entry.
##
127.0.0.1 localhost
255.255.255.255 broadcasthost
::1 localhost
192.168.10.10 project1.app
192.168.10.10 project2.dev
I have tried the following:
vagrant provision
vagrant reload --provision
Destroyed box and vagrant up
vagrant global-status, followed by vagrant provision vm#
have also tried to map folders and sites
ex:
folders:
- map: ~/WWW/project1
to: /home/vagrant/Code/project1
- map: ~/WWW/project2
to: /home/vagrant/Code/project2
sites:
- map: /project1.app
to: /home/vagrant/Code/project1/public
- map: /project2.dev
to: /home/vagrant/Code/project2/public
First, one tip: use nfs because windows folder share is very very slow. To add support for this feature on Windows you should install vagrant-winnfsd
vagrant plugin install vagrant-winnfsd
folders:
- map: ~/WWW
to: /home/vagrant/Code
type: nfs
Just in case remove the slash before the site hostname. I don't have sure if this is the reason but was the only thing wrong I found in your configuration.
sites:
- map: project1.app
to: /home/vagrant/Code/project1/public
- map: project2.dev
to: /home/vagrant/Code/project2/public
Another tip: install the vagrant-hostsupdater plugin to add the hostnames to your hosts file automatically.
vagrant plugin install vagrant-hostsupdater
in you Homestead.yaml file:
aliases: ["project1.app", "project2.dev"]
in scripts/homestead.rb file:
config.hostsupdater.aliases = settings["aliases"]
My files: homestead.rb and Homestead.yaml
Got it.
The slashes before the domain where causing the issue.
Changed this:
sites:
- map: /project1.app
to: /home/vagrant/Code/project1/public
- map: /project2.dev
to: /home/vagrant/Code/project2/public
To this:
sites:
- map: project1.app
to: /home/vagrant/Code/project1/public
- map: project2.dev
to: /home/vagrant/Code/project2/public

Resources