getting Laravel running on a VM on imac - php

I am trying to get Laravel running on a Virtual Machine on my Imac running Yosemite. I have already set up my VM on my Macbook but for some reason I am having trouble getting the virtual machine working on my Imac. I believe I have all the directory paths correct but when I ssh into the VM none of my directories show up. I believe it is something to do with my directory paths but I have them routed exactly as I do on my Macbook and it still doesn't seem to work. I also get these two errors when I run "vagrant up" but from what Ive researched that shouldn't be the issue.
/opt/vagrant/bin/../embedded/gems/gems/vagrant-1.7.2/lib/vagrant/pre-rubygems.rb:31:
warning: Insecure world writable dir /Users/tylerfoulkes in PATH, mode 040777
/opt/vagrant/embedded/gems/gems/bundler-1.7.11/lib/bundler/runtime.rb:222: warning: Insecure world writable dir
/Users/tylerfoulkes in PATH, mode 040777
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: /Users/username/laravel
to: /home/vagrant/Code
sites:
- map: learn.app
to: /home/vagrant/Code/laravel/public
databases:
- homestead
variables:
- key: APP_ENV
value: local
# blackfire:
# - id: foo
# token: bar
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
fe80::1%lo0 localhost
127.0.0.1 learn.app

Your sites folder should point to /home/vagrant/Code/public not /home/vagrant/Code/laravel/public because youare mapping the laravel folder on to Code not in to a sub directory.
folders:
- map: /Users/username/laravel
to: /home/vagrant/Code
sites:
- map: learn.app
to: /home/vagrant/Code/public
Or if you want laravel in a sub directory
folders:
- map: /Users/username/laravel
to: /home/vagrant/Code/laravel
sites:
- map: learn.app
to: /home/vagrant/Code/laravel/public
Unless of course the laravel directory contains a bunch of different laravel projects in which case it would look more like...
folders:
- map: /Users/username/laravel
to: /home/vagrant/Code
sites:
- map: project.app
to: /home/vagrant/Code/project/public
- map: project2.app
to: /home/vagrant/Code/project2/public

Related

Problem with setting up phpMyAdmin with Homestead and Vagrant

I am trying to install phpMyAdmin with Homestead and Vagrant in Laravel. When I download phpMyAdmin files I ran successful install in git bash, but when I go to http://phpmyadmin.test:8000/ I get error saying 'No input file specified'.
I think that some of my paths are wrong I just can't find which one. Every time I change something I hit vagrant provision command to update everything but it keeps getting the same error. I googled for similar problems, but couldn't find the solution that works for me. Any help is appreciated. Here is my code.
Homestead.yaml
ip: "192.168.10.10"
memory: 2048
cpus: 2
provider: virtualbox
authorize: ~/.ssh/id_rsa.pub
keys:
- ~/.ssh/id_rsa
folders:
- map: C:\laravel-projects
to: /home/vagrant/code
- map: /Users/Gacho/code/phpMyAdmin
to: /home/vagrant/code/phpMyAdmin
sites:
- map: real-estate-laravel.test
to: /home/vagrant/code/real-estate-laravel/public
- map: phpmyadmin.test
to: /home/vagrant/code/phpMyAdmin/
databases:
- real-estate-laravel
hosts
192.168.10.10 real-estate-laravel.test
127.0.0.1 phpmyadmin.test
path to homestead folder
C:\Users\Gacho\Homestead
path to project folder
C:\laravel-projects\real-estate-laravel
You forgot to use the real-estate-laravel subfolder.
folders:
- map: C:\laravel-projects
to: /home/vagrant/code <--- missing subfolder here
- map: /Users/Gacho/code/phpMyAdmin
to: /home/vagrant/code/phpMyAdmin <--- missing subfolder here
Try
folders:
- map: C:\laravel-projects
to: /home/vagrant/code/real-estate-laravel
- map: /Users/Quantox/code/phpMyAdmin
to: /home/vagrant/code/real-estate-laravel/phpMyAdmin

Existing project run with Laravel homestead (5.4)

I have installed Laravel homestead it's working fine. my problem is how I map existing project to homestead? my Homestead.yaml file as bellow
---
ip: "192.168.10.10"
memory: 2048
cpus: 1
provider: virtualbox
authorize: ~/.ssh/id_rsa.pub
keys:
- ~/.ssh/id_rsa
folders:
- map: D:/www/Laravel
to: /home/vagrant/Code/Laravel
sites:
- map: homestead.app
to: /home/vagrant/Code/Laravel/public
databases:
- homestead
This project generated from Homestead I have another exist project and how to map homestead.I added following code to Homestead.yaml file but it was not working.
- map: D:/www/MyProject
to: /home/vagrant/Code/MyProject
Please anyone can help me Thank you.
you should edit your folders section to map to you www directory
folders:
- map: D:/www
to: /home/vagrant/Code
this will allow you to store all of your projects within D:/www directory and all of them will be mapped to your VM.
now you can add your Site
you should add this under Sites
- map: my-project.app
to: /home/vagrant/Code/MyProject/public
this assumes that your project is located at D:/www/MyProject
also don't forget to add new domain to your hosts file
192.168.10.10 my-project.app
and run vagrant reload --provision
Try this:
---
ip: "192.168.10.10"
memory: 2048
cpus: 1
provider: virtualbox
authorize: ~/.ssh/id_rsa.pub
keys:
- ~/.ssh/id_rsa
folders:
- map: D:/www/
to: /home/vagrant/Code/
sites:
- map: MyProject.app
to: /home/vagrant/Code/MyProject/public
databases:
- homestead
Make sure that:
1) There is a code folder inside C:/users/{currentuser}/
2) You have MyProject folder in D:/www
3) A virtual hosts file entry:
Vagrant box IP MyProject.app
And at last fire vagrant reload --provision command within C:/users/{currentuser}/Homestead folder

Homestead no input file specified for custom PHP project

I'm working with Homestead. Laravel apps are just serving fine, but when I try to setup some custom script, it shows me that No input file specified.
Here is my yaml file.
---
ip: "192.168.30.30"
memory: 2048
cpus: 1
provider: virtualbox
authorize: ~/.ssh/id_rsa.pub
keys:
- ~/.ssh/id_rsa
folders:
- map: /Users/Mubin/Sites
to: /home/vagrant/Code
sites:
- map: test.app
to: /home/vagrant/Code/test/public
- map: dev.app
to: /home/vagrant/Code/dev/index.php
databases:
- homestead
I just want to put all my code under dev folder and want to access it from vagrant homestead box
Guide where am I doing wrong?
PS.
I tried to remove index.php from the end, and then nginx throws 403 Forbidden
anyone having the same issue, I found a solution, mocked one may be; but it did work for me.
I added new public folder in my dev folder and place all my other custom PHP scripts put in that.
Directory structure was something like this for me
dev
public
folder1
index.php
folder2
index.php
folder3
index.php
...
and I was able to access it like this
dev.local/folder1/index.php
dev.local/folder2/index.php
dev.local/folder3/index.php
and here is my Homestead.yaml file
---
ip: "192.168.30.30"
memory: 2048
cpus: 1
provider: virtualbox
authorize: ~/.ssh/id_rsa.pub
keys:
- ~/.ssh/id_rsa
folders:
- map: /Users/Mubin/Sites
to: /home/vagrant/Code
sites:
- map: test.app
to: /home/vagrant/Code/test/public
- map: dev.local
to: /home/vagrant/Code/dev/public
databases:
- homestead
and in my /etc/hosts file
127.0.0.1 dev.local test.app
Hope this will help someone, someday. :)
I'd set up vagrant for laravel and custom PHP projects. Also, integrated with PHP Storm to work with x-debug. Leave a message if you've any issue.
Happy coding, x-debugging.

Mapping Folders and Sites in Laravel/Homestead

I have slowly been working on getting Laravel/Homestead up on ubuntu 15.1 and am struggling to get my folders and sites mapped in my Homestead.yaml file. The virtual machine is up and running, when I go to Homestead.app in the browser it tells me that no input file specified. I know that I don't have it mapped correctly.
---
ip: "192.168.10.10"
memory: 2048
cpus: 1
provider: virtualbox
authorize: ~/.ssh/id_rsa.pub
keys:
- ~/.ssh/id_rsa
folders:
- map: ~/Homestead/Projects/Laravel
to: /home/vagrant/Projects
sites:
- map: homestead.app
to: /home/goldenos/Homestead/Projects/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
I have my index.php file in ~/Homestead/Projects in a folder named Laravel if I need to provide any additional information please let me know and I will provide it asap. Thanks in advance for any information!
-Luke
Try THIS instead:
folders:
- map: ~/Homestead/Projects // your local whole projects folder on the host machine (so you can setup multiple websites on the same virtual box)
to: /home/vagrant/Projects // synced folder in virtual box
sites:
- map: homestead.app
to: /home/vagrant/Projects/Laravel/public // path of project in the virtual box
- map: site2.app
to: /home/vagrant/Projects/Site2/public
Don't forget to run vagrant up/reload flagging --provision after you edited your .yaml file like:
vagrant up --provision
OR
vagrant reload --provision

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