I'm trying to install Homestead on a Mac using VirtualBox and when I edit the homstead.yaml file to change the location of my local shared folder the change never registers, as I always get the error
The host path of the shared folder is missing: ~/Code
when I vagrant up.
When I performed bash init.sh I was asked to overwrite homestead.yaml, after.sh, and aliases. I've been having this problem for a while now and have tried many different things but nothing seems to work. I new with Laravel and would appreciate some help. Thanks!
In your Homested.yaml file but make sure you have folder in your C:\Code
folders:
- map: C:/Code
to: /home/vagrant/Code
sites:
- map: homestead.app
to: /home/vagrant/Code/Laravel/public
Related
I try to setup a new Homestead VM with vagrant but if I try to start with vagrant upI get the information
vm:
* The host path of the shared folder is missing: ~/Code
But in my Homestead.yaml under ./src/stubs/ I set the folder property to:
folders:
- map: J:/Eigene Daten/Gerrit/Development/PHP Storm/TestApp
to: /home/vagrant/TestApp
sites:
- map: vagrant.dev
to: /home/vagrant/TestApp/public
Can anybody tell my why this happens?
Thanks!
It must be somewhere
You try to define a synchronized folder with ~/Code but vagrant cannot find the folder. You can see by your self and create this Code directory in your home and vagrant up will work
We can't say where it is defined without looking at your configuration
I am new on vagrant. I am using Laravel Homestead Improved by following this
link. I want to map my existing code on vagrant which is inside my xampp installation. Here is my Homestead.yaml file contents.
ip: "192.168.10.10"
memory: 2048
cpus: 1
sites:
- map: myapp.com
to: /home/vagrant/Code
folders:
- map: /opt/lampp/htdocs/codebase
to: /home/vagrant/Code
variables:
- key: APP_ENV
value: local
Although when I run the following command
cd Code/
it shows my code but on browser when I run http://myapp.com:8000/ it shows "No input file specified."
By default a webserver usually looks for index.html then index.php, neither of these files are in your /home/vagrant/Code folder which is why you're getting the "No input file specified" error.
On your sites section, you should map the domain to your public folder of Laravel. So in this case it should likely be /home/vagrant/Code/public
You mapped codebase to Code, and you mapped myapp.com to Code.
If you currently have an app in codebase/app1/index.php, then this wouldn't work because myapp.com is looking for index.php inside Code.
Thus, you need to access either: myapp.com:8000/app1 OR you need to remap sites like so (and do this for every site/app folder inside codebase):
sites:
- map: myapp.com
to: /home/vagrant/Code/app1
Note that you need to replace app1 with whatever you called your app's folder in XAMPP
I have just made the following Homestead.yaml file:
authorize: ~/.ssh/id_rsa.pub
keys:
- ~/.ssh/id_rsa
folders:
- map: ~/GIT/old-project
to: /home/vagrant/old-project
- map: ~/GIT/project
to: /home/vagrant/project
sites:
- map: old-project.app
to: /home/vagrant/old-project/public
- map: project.app
to: /home/vagrant/project/public
databases:
- name: old-project
- name: project
variables:
- key: APP_ENV
value: local
old-project already existed. Next I ran vagrant up, then vagrant ssh then inside the vagrant box I ran composer create-project laravel/laravel project 4.2 --prefer-dist. Laravel installed. I edited my /etc/hosts file and now project.app leads me to the Laravel 'You have arrived' page. Great – everything works.
But on my mac, the folder ~/GIT/project is empty.
What part of the installation process did I miss? Is there anything I've done wrong that has prevented the files from mapping across correctly?
If I open ~/GIT/old-project all the Laravel files are there, and it works as I'd expect. I can't remember any difference in how I set up that project.
I guess you should run the vagrant provision command, to make the added directory (~/GIT/project) shared with the homestead.
When you run the command vagrant up for the first time, the directory ~/GIT/old-project became shared with the homestead. However the directory ~/GIT/project is not shared therefore it is empty on your mac.
Note: When running the provision command, your existing databases will be destroyed and recreated.
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
So I am trying to setup homestead on my windows machince but I keep getting the 'No input file specified' but im prettu sure I got the path corretly because they where working before. My homestead yaml file is like the following.
folders:
- map: C:\Users\Steve\Dropbox\Work\Laravel
to: /home/vagrant/Code/
sites:
- map: homestead.app
to: /home/vagrant/Code/Laravel/public
Now the files are syncing between one another and inside of Laravel I have another Laravel folder which contains the frameowrk.
When i run homestead.app I get the error and as you can see in the screenshot below the paths are matching together. If you shed some light I would greatly appreciate.
I have tried homestead destroy and homestead destroy multiple time.