"No input file specified." when running Laravel Homestead - php

I've installed Laravel Homestead and edited my host file but when I visit the specified URL in my browser I get the message "No input file specified." after running "vagrant up" in terminal. My initial guess is something's incorrect in the Homestead.yaml file but I can't see what.
I'm running Mac OS and my VM is a VirtualBox one. All my websites are in a folder called "Sites" which is a direct child of the OS user, so Username/Sites. The path of my Homestead folder is also in there like this: _Username/Sites/_homestead".
In the Homestead.yaml file I set my 'folder' to map: ~/Sites - that should mean when I visit the specified URL in the browser I get a list of folders (all of my websites), right? Or at least that was the result I'm expecting.
If I type ~Sites/ in my browser address bar I do see a list of folders so the location is correct. It redirects to file:///Users/USERNAME/Sites/
Before I run vagrant up 'username.dev' will not work when typed in the address bar, afterwards it does. So I assume that's all correct as it does pick it up.
This is the contents of my Homestead.yaml file for reference:
---
ip: "192.168.10.10"
memory: 2048
cpus: 1
provider: virtualbox
authorize: ~/.ssh/id_rsa.pub
keys:
- ~/.ssh/id_rsa
folders:
- map: ~/Sites
to: /home/vagrant/Code
sites:
- map: username.dev
to: /home/vagrant/Code/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
Can anyone see what's wrong or advise on what else is could be?

Apparently you have to specify a specific folder, but if you want to switch quickly between your different projects you can map to multiple directories in the homestead.yaml file like that:
sites:
- map: firstProject.dev
to: /home/vagrant/Code/firstProject/public
- map: secondProject.dev
to: /home/vagrant/Code/secondeProject/public
You executed the command vagrant up --provision and still the same output?
I found similar questions which might help you here :
Using Laravel Homestead: 'no input file specified' and After installing Homestead I get "No input file specified" in the browser. How can I access my laravel project

if the folder Username/Sites contains different site folders, try to map the URL to: /home/vagrant/Code/yourSiteFolderName/public
and run vagrant reload --provision or vagrant up --provision to reload the configuration

For me after hours of searching I realized I had a capitalization error :(
- map: C:/Users/jason/Code/blog
to: /home/vagrant/Code/blog
sites:
- map: blog.test
to: /home/vagrant/***code***/blog/public
Code was code in the sites to: section.
So just an caution to everyone to check for the simplest errors first ;)

Related

No way to make Laravel/Homestead work –show in browser

Having spent 1.5 days trying to fix this I thought that I might as well come before you for an answer.
Newbie in Laravel, I've been trying to set up the dev environment in my laptop (MacOS, High Sierra 10.13.6).
I've installed Virtual Box, Vagrant (v 2.2.9), Composer & Homestead
This is what my Homestead.yaml looks like:
---
ip: "192.168.10.10"
memory: 2048
cpus: 2
provider: virtualbox
authorize: ~/.ssh/id_rsa.pub
keys:
- ~/.ssh/id_rsa
folders:
- map: ~/Laravel
to: /home/vagrant/Laravel
sites:
- map: test.app
to: /home/vagrant/Code/Laravel/public
databases:
- test
features:
- mariadb: false
- ohmyzsh: false
- webdriver: false
# ports:
# - send: 50000
# to: 5000
# - send: 7777
# to: 777
# protocol: udp
I've also configured my /etc/hosts file as follows:
1922.168.10.10 localhost
255.255.255.255 broadcasthost
::1 localhost
192.168.10.10 test.app
I've been experimenting with the paths in the folders and sites, also following different suggestions from forums but, if anything, I get from my browser either:
No input file specified
or
ERR_CONNECTION_REFUSED
Some few additional info:
The official Laravel documentation says that you have to map folders to each and every project, but the tutorials out there say that you only have to map it to the folder that will contain all project folders.
I've tried to match the IPs in Homestead.yaml and /etc/hosts but at least when they were different (192.168.10.10 and 127.0.0.1 respectively I got the No input file specified, which -I think- it means that at least the browser managed to connect to the server, but didn't find the right file.
As for Vagrant, I can vagrant up, vagrant halt, and vagrant destroy without further issues when I cd in my Homestead folder. I can also vagrant ssh without further issues.
The file receiver of the installation of Laravelcomposer global require laravel/installer is named Laravel and located in /Code and same level as Homestead.
All help will be dearly appreciated. Please ask anything else I may have missed.
Thanks so much in advance. I hope this helps future Laravel newbies as well.
Resources used:
Mainly this tutorials + this tutorial + this post + a few hours of Googling around.

No input file specified. (Laravel with homestead)

I'm trying to set up laravel 5.5 working with homestead.
I've followed the steps here up to and including launching the vagrant box.
However, typing "dev.todoparrot.com" or "192.168.10.10" into browser brings up "No input file specified." error.
Trying
vagrant up --provision
(since I made changes to homestead.yaml) did not fix it.
My homestead.yaml looks like:
ip: "192.168.10.10"
memory: 2048
cpus: 1
provider: virtualbox
authorize: C:/Users/User/.ssh/id_rsa.pub
keys:
- C:/Users/User/.ssh/id_rsa
folders:
- map: D:/projects/todoparrot
to: /home/vagrant/Code
sites:
- map: dev.todoparrot.com
to: /home/vagrant/Code/todoparrot/public
I've installed laravel 5.5 into "D:/projects/todoparrot" with composer. Running php artisan serve on this folder works normally - template site is found at http://127.0.0.1:8000/.
Running
vagrant ssh
or Putty and navigating to /Code and typing ls returns the same files that are in "D:/projects/todoparrot", so the sync is working.
Changing
sites:
- map: dev.todoparrot.com
to: /home/vagrant/Code/todoparrot/public
to
sites:
- map: dev.todoparrot.com
to: /home/vagrant/Code/public
fixed my problem. Following tutorial without thinking about what I'm doing was the root of my mistake.

Laravel Homestead "No input file specified"

I installed Laravel with Homestead and tried to start a project that I created. Therefore I adjusted the Homestead.yaml to:
ip: "192.168.10.10"
memory: 2048
cpus: 1
provider: virtualbox
authorize: ~/.ssh/id_rsa.pub
keys:
- ~/.ssh/id_rsa
folders:
- map: ~/Documents/Development/Source/MFServer/
to: /home/vagrant/Code
sites:
- map: local.medifaktor
to: /home/vagrant/Code/MFServer/public
The path is existing but still I get this error message. Can you give me some advice?
I think this only works when you need to reload the file and there is no other problems.
From Jesús' site: http://www.jesusamieiro.com/no-input-file-specified-using-homestead/
“No input file specified” using Homestead - Posted on 02/06/2016
If you see the message “No input file specified” in the browser (using Homestead as development VM machine), one possible problem is that Homestead doesn’t load the parameters from the config file Homestead.yaml
Try to provision the VM another time, running
$ vagrant reload --provision

Does laravel/homestead box comes with default website setup?

I am trying to figure out if there is something wrong in my homestead setup
I am following the official direction. In the very end of the direction the tutorial said that accessing http://homestead.app is possible. However when I run the address in my chrome I get the No input file specified. message
I am not sure if this is the default page, so I checked my directory using
homestead ssh
and found out that
- map: /Users/Projects
to: /home/vagrant/Projects
both directory doesn't have any files inside, I am not sure if this is the default behavior, but according to this tutorial there should be a list of file in the folder
app artisan bootsrap composer.json composer.lock ....
I don't remember if homestead comes with a default website, but your homestead.yaml ( you can use homestead edit to open it )file should look like this:
---
ip: "192.168.10.10"
memory: 2048
cpus: 1
provider: virtualbox
authorize: ~/.ssh/id_rsa.pub
keys:
- ~/.ssh/id_rsa
folders: //This is where vagrant will look for your projects
- map: ~/Code //This is your host folder
to: /home/vagrant/Code //This is your homestead folder
sites: //These are the urls that nginx will serve
- map: homestead.app
to: /home/vagrant/Code/homestead/public
- map: site2.app
to: /home/vagrant/Code/site2/public
databases:
- homestead
variables:
- key: APP_ENV
value: local
Usually, homestead comes with a Code folder where you can find the laravel project (if there is one by default).
Also, remeber to add the urls to your hosts files.

No input file specified when typing homestead.app as the url

So I have installed laravel through composer, the virtual box machine and homestead. Everything is fine but now when I try to access the url homestead.app as shown in the instructions, I get the No input file specified. Below is the content of my homestead.yaml... for the folders, I pointed it to my local area where I have the laravel source called installed under XAMPP/htdocs... What am I doing wrong ?
---
ip: "192.168.10.10"
memory: 2048
cpus: 1
provider: virtualbox
authorize: ~/.ssh/id_rsa.pub
keys:
- ~/.ssh/id_rsa
folders:
- map: C:/xampp/htdocs/learning-laravel-5/public
to: /home/vagrant/Code
sites:
- map: homestead.app
to: /home/vagrant/Code/Laravel/public
databases:
- homestead
variables:
- key: APP_ENV
value: local
# blackfire:
# - id: foo
# token: bar
Your configuration is a bit off I believe.
First you map your project's public directory to you virtual box's Code directory. Then you map your site to the Laravel/public directory inside the directory you just mapped. So in fact you are trying to access C:/xampp/htdocs/learning-laravel-5/public/Laravel/public from you web server, which probabaly doesn't exist.
Personally I would map my VM's Code directory to my htdocs folder. This way you will have access to all files in there from inside your VM. Your site should be mapped slightly diffrent as well then. I believe it would look similar to this:
...
folders:
- map: C:/xampp/htdocs
to: /home/vagrant/Code
sites:
- map: homestead.app
to: /home/vagrant/Code/learning-laravel-5/public
...
Also, don't forget to set up a host to have homestead.app point to the correct IP (192.168.10.10)

Categories