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.
Related
I am getting the "No input file specified" error when running the app in the browser.
It should provide me with the Laravel home page.
Homestead.yaml
ip: "192.168.10.10"
memory: 2048
cpus: 2
provider: virtualbox
authorize: ~/.ssh/id_rsa.pub
keys:
- ~/.ssh/id_rsa
folders:
- map: ~/Code
to: /home/vagrant/Code
sites:
- map: laravel6.test
to: /home/vagrant/Code/laravel6.test/public
hosts file
#
127.0.0.1 localhost
192.168.10.10 laravel6.test[enter image description here][1]
Here's how to fix it you need to have your homestead.yaml file settings correct. If you want to know how its done follow Jeffery Way tutorial on homestead 2.0 https://laracasts.com/lessons/say-hello-to-laravel-homestead-two.
Now to fix "Input not specified" issue you need to ssh into homestead box and type
"serve domain.app /home/vagrant/Code/path/to/public/directory" this will generate a serve script for nginx. You will need to do this everytime you switch projects
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
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
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.
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)