PhpMyAdmin on Laravel 5 Homestead, Windows - laravel

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

Related

Laravel Homestead - ‘no input file specified’

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

can't find downloaded laravel files in mapped homestead folder

i just set up homestead and made sure that my folder is mapped correctly( by displaying some php content ), but when i download laravel from the virtual machine i can't find the files in the mapped folder.
homestead.yaml :
ip: "192.168.10.10"
memory: 2048
cpus: 1
provider: virtualbox
authorize: ~/.ssh/id_rsa.pub
keys:
- ~/.ssh/id_rsa
folders:
- map: C:/Users/neo/Code
to: /home/vagrant/Code
sites:
- map: homestead.app
to: /home/vagrant/Code/Laravel/public
- map: fresh.app
to: /home/vagrant/Code/fresh/public
databases:
- homestead
- fresh
hosts:
127.0.0.1 localhost
127.0.0.1 localhost
192.168.10.10 fresh.app
Make sure your laravel homestead is in your home root's directory. Also
Change your
- map: C:/Users/neo/Code
to
- map: /Users/neo/Code
Then in your Homestead environment run command:
vagrant reload --provision
It should work fine now and map your folder.

Laravel 5 Homestead Multiple Sites on Local Network

I have two Laravel projects on a Homestead machine.
Homestead.yaml
sites:
- map: homestead.app
to: /home/vagrant/Code/Laravel/public
- map: blog.app
to: /home/vagrant/Code/Blog/public
and /etc/hosts:
192.168.10.10 homestead.app
192.168.10.10 blog.app
And everything works as expected. But when I want to access sites from a phone on a local network and go to
192.168.1.100:8000
It takes me to a Blog project. Is there a way for all projects to be accessible at all times?
I read this How to connect to Homestead which has multiple sites through mobile device?, but you have to pick one project to be accessible. And you have to edit Homestead.yaml and reload vagrant every time you want to swap projects.
I have just figured this out myself, and I have posted answers here (Homestead cant access second site remotely) and here (Laravel homestead multiple sites choose which one is locally accesable).
In short:
sites:
- map: homestead.app
to: /home/vagrant/Code/Laravel/public
port: 81
- map: blog.app
to: /home/vagrant/Code/Blog/public
ports:
- send: 8100
to: 81
Then access your homestead.app project via http://192.168.1.100:8100.

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

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