Laravel Homestead - ‘no input file specified’ - laravel

I've set up the project many times, but this time, when I use vagrant up and try to go into the website, it says "no input file specified".
I have set up the hosts file
I have logged to the vagrant ssh to ensure the files/folders are linking and they are
I have tried destroying the virtual machine, building it again, --provision etc..
This is the code for the project from the Homestead file
folders:
-
map: ~/portfolio
to: /home/vagrant/code
sites:
-
map: portfolio.test
to: /home/vagrant/code/public
php: "7.2"
No matter what I do, I just go between the errors "No input file specified" and "403 Forbidden
nginx/1.15.6"

Check if your path are correct and the folders exist.
Open your command line and move to the location and run following command
pwd
That is going to return the path.
You are also not pointing in to your actual project, shouldn't this:
folders:
-
map: ~/portfolio
to: /home/vagrant/code
sites:
-
map: portfolio.test
to: /home/vagrant/code/public
php: "7.2"
be something like this:
folders:
-
map: ~/portfolio
to: /home/vagrant/code
sites:
-
map: portfolio.test
to: /home/vagrant/code/myapp/public
php: "7.2"
Further you should try following:
homestead up --provision
or
vagrant up --provision

Related

PhpMyAdmin on Laravel 5 Homestead, Windows

I downloaded phpmyadmin to my /Code folder, and then updated my Homestead.yaml file:
folders:
- map: C:\Users\{ myname }\Code
to: /home/vagrant/Code
- map: C:\Users\{ myname }\Code\phpmyadmin
to: /home/vagrant/Code/phpmyadmin
sites:
- map: homestead.app
to: /home/vagrant/Code/Laravel/public
- map: phpmyadmin.app
to: /home/vagrant/Code/phpmyadmin
I updated my hosts file also...
{ ip from homestead.yaml} phpmyadmin.app
When I browse to phpmyadmin.app it displays the same site as homestead.app.
I'm using Windows.
Is there some way to restart homestead? How do I get this to work?
You'll need to reprovision your homestead vm with
vagrant provision
See Adding Additional Sites

After installing Homestead I get "No input file specified" in the browser. How can I access my laravel project

I think I finally got homestead installed on my laptop! Now, I am trying to view my laravel project in the browser.
When I open "dev.app" in the browser I get a message that say "No input file specified." which I think means that my homestead is working but the laravel project is not there/setup.
I have created a folder called Projects on my local laptop (i.e. ~/Projects). Then from inside of it i executed this command
laravel new dev
But I still get the same error message in the browser i.e. "No input file specified." I have also tried to open this link "dev.app"/dev" but I still get the same message.
What I am doing wrong?
Here is the content of my Homestead.yaml file
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/Code
sites:
- map: dev.app
to: /home/vagrant/Code/Laravel/public
databases:
- homestead
variables:
- key: APP_ENV
value: local
Additional, when I execute the following 2 commands in order
cd ~/Projects
ls
I see the following directories dev homestead
What should I do to see my project when I go to dev.app ? Do I need to do anything from my Ubuntu VM or I should be able to edit the files directly in located on ~\Projects\dev" from my laptop?
Add an entry in /etc/hosts on your local machine
192.168.10.10 dev.app
Correct the path to the public folder in the sites section of your Homestead.yaml
sites:
- map: dev.app
to: /home/vagrant/Code/dev/public

Multiple folders for homestead not syncing

My first homestead project worked without a hitch here's the core part of the homstead.yaml
folders:
- map: C:\dev\bitbucket
to: /home/vagrant/bb
sites:
- map: project.dev
to: /home/vagrant/bb/example/project/public
now I wanted to add a different folder into the mix so I extended the yaml to
folders:
- map: C:\dev\bitbucket
to: /home/vagrant/bb
- map: C:\dev\github
to: /home/vagrant/gh
sites:
- map: project.dev
to: /home/vagrant/bb/example/project/public
- map: another.dev
to: /home/vagrant/gh/example/another/public
I run homestead provision and now I can access another.dev but I got the error No input file specified. So I ran the command homestead ssh and cd /home/vagrant followed by ls and all I see is the bb folder and not the gh
I found multiple places that mention multiple sites syntax, but couldn't find something mentioning multiple folders (although as the name suggests folders is plural, so I thought this should be possible)
What am I missing?
sometimes homestead doesn't provision correctly and needs a full reboot. while this isn't ideal, one workaround is to use homestead halt followed by homestead up to recreate the provisioning process for the VM.
a bit of my homestead file
u are not allowed to change this directory /home/vagrant/Projects to something else
folders:
- map: ~/Projects
to: /home/vagrant/Projects
sites:
- map: aone.dev
to: /home/vagrant/Projects/aone/public
- map: booking.dev
to: /home/vagrant/Projects/booking/public
- map: nish.dev
to: /home/vagrant/Projects/nish/public
- map: shazdekocholo.dev
to: /home/vagrant/Projects/shazdekocholo/public
- map: hejab.dev
to: /home/vagrant/Projects/hejab/public

The host path of the shared folder is missing: ~/Code

I'd like to use laravel homestead for my development machine and installed virtualbox and vagrant successfully, but when I run vagrant up I get this error:
Bringing machine 'default' up with 'virtualbox' provider...
There are errors in the configuration of this machine. Please fix
the following errors and try again:
vm:
* The host path of the shared folder is missing: ~/Code
The Homestead.yaml file looks like this:
---
ip: "192.168.10.10"
memory: 2048
cpus: 1
authorize: ~/.ssh/id_rsa.pub
keys:
- ~/.ssh/id_rsa
folders:
- map: ~/Code
to: /home/vagrant/Code
sites:
- map: homestead.app
to: /home/vagrant/Code/Laravel/public
hhvm: true
databases:
- homestead
variables:
- key: APP_ENV
value: local
These are the default settings, but they don't really work for my machine - I don't even have /home/vagrant folder nor do I have ~/Code anywhere where I can see. I'm using ubuntu 12.04 - can you please point me to how I should configure my settings because by the official documentation I'm kind of lost.
Inside the homestead directory, you have to run the command bash init.sh.
This will generate the Homestead.yaml file (and after.sh and aliases) inside your home directory (~).
If you are changing Homestead.yaml again, you have to re-run bash init.sh again. It will ask for overwrite, say yes.
(and as mentioned in other answers, be sure that the directory for folders: - map: exists)
In your Ubuntu machine you have to let Homestead know where your actual code is located. Example:
If you code is located in a seperate partition called WORKSPACE you need to type the following:
- map: /Volumes/WORKSPACE/YourProject
to: /home/vagrant/Code
In Windows case I used this:
- map: e:/GIT/PHP/mathmaps/Code
to: /home/vagrant/Code
P.S. GIT is my workspace folder
running bash init.sh a second time will prompt to overwrite the initial setup, this will also output the directory path you require to edit the correct Homestead.yaml file.
The map: attribute has to be set to the location to where you want to keep your code. For example, I will be saving my code in a folder called code within the Homestead folder therefore, map is:
folders:
- map: ~/Development/Homestead/Code
to: /home/vagrant/Code
Where 'Development' is simply a folder in my home directory where I keep all my code

Homestead 2.0 multiple sites, all link to the same url

Hee guys, little question: So i have setup the Homestead 2.0 and everything is working fine. I wanted to add another project in the same code directory but link it to another url. So i added it in the sites list but when i visited laravel.app it all works fine, but when I visit larabook.app it shows me the laravel.app page! Both urls are linked to 192.168.10.10 in my /etc/hosts file.
I have tried restarting my mac and restarting the vm but nothing is working :'(
/etc/hosts
192.168.10.10 laravel.app
192.168.10.10 larabook.app
Homestead.yaml
folders:
- map: ~/Code
to: /home/vagrant/Code
sites:
- map: laravel.app
to: /home/vagrant/Code/Laravel/public
- map: larabook.app
to: /home/vagrant/Code/Larabook/public
databases:
- homestead
- larabook
Assuming your Homestead.yaml file above
type in:
$ vagrant global-status
will display something like;
id name provider state directory
--------------------------------------------
77c5c30 default virtualbox running et....
type in:
$ vagrant provision 77c5c30
Of course this assumes you only have 1 VM, if you have others then read the instruction when you run vagrant provision
This works for me, and didn't lose the database:
$ homestead halt
$ homestead up --provision
Try this
folders:
- map: ~/Code/Laravel
to: /home/vagrant/Code/Laravel
- map: ~/Code/Larabook
to: /home/vagrant/Code/Larabook
sites:
- map: laravel.app
to: /home/vagrant/Code/Laravel/public
- map: larabook.app
to: /home/vagrant/Code/Larabook/public
databases:
- homestead
- larabook
Note: look at the changes i have made to the folders section.
find out more from https://www.easylaravelbook.com/blog/configuring-multiple-laravel-homestead-sites-and-databases/#top
after run
$ homestead halt
$ homestead up --provision

Resources