Homestead / Homestead.yaml (Windows) no input file specified - php

I used to work with homestead on a mac machine, but since i don't have access to that mac machine anymore i'm back on my windows machine.
So today i installed homestead with no problems, ran vagrant up and got: No input file specified.
which is normal because i didn't set my homestead.yaml to the right folders. so this i where i started to ran into problems.
I have a .Projects folder in my user directory and there i have a laravel 5.4 installation called test
this is my homestead.yaml (only the folder's and site's section)
folders:
- map: ~/Projects
to: /home/vagrant/Projects
sites:
- map: test.dev
to: /home/vagrant/Projects/test/public
Still the same message and i realy don't know why i hope someone with homestead + windows can help me !

You need to serve your site from homestead ssh.
serve test.dev /home/vagrant/Projects/test/public
then sudo nginx restart
You need to register your site from homestead first.

Related

Laravel Homestead - site cant be reached. Windows 10

Im getting started with Laravel Homestead and spend half a day working with tutorials and manuals.
The problem is that everything looks perfect - without any errors, but still I cant see laravel welcom page.
I've installed vagrant and virtual box.
at c:/windows/system32/drivers/etc/hosts added line like:
# 192.168.10.10 homestead.test
My directory tree looks like:
~/Server/.ssh
~/Server/Code
~/Server/Homestead
I made .ssh keys and using git bash:
cd Server
git clone https://github.com/laravel/homestead.git Homestead
cd Homestead
bash init.sh
and configured homestead.yaml file:
ip: "192.168.10.10"
memory: 2048
cpus: 2
provider: virtualbox
authorize: ~/Server/.ssh/id_rsa.pub
keys:
- ~/Server/.ssh/id_rsa
folders:
- map: ~/Server/Code
to: /home/vagrant/code
sites:
- map: homestead.test
to: /home/vagrant/code/homestead/public
databases:
- homestead
features:
- mariadb: false
- ohmyzsh: false
- webdriver: false
# ports:
# - send: 50000
# to: 5000
# - send: 7777
# to: 777
# protocol: udp
Everything looks fine to me so far, is it?
Next in shell:
vagrant up
vagrant ssh
successfully logged to laravel and changed directory to only one existing code, then:
laravel new homestead
Finished iwth message Application ready! Build something amazing.
Did also another one project with different names, but when I type in my chrome browser homestead.test or whatever I call my project -> This site can't be reached.
Thanks for your help.
It sounds like you made the vagrant box first then created a new app after ssh into the vagrant box. I usually take different steps.
Make sure vagrant is installed. https://www.vagrantup.com/downloads.html
Make sure the laravel/homested box has been added to vagrant vagrant box add laravel/homestead
Make sure homestead is installed on the home directory in a file named Homestead git clone https://github.com/laravel/homestead.git ~/Homestead https://laravel.com/docs/7.x/homestead#first-steps
install homestead into your project composer require laravel/homestead --dev
use the make command to generate the vagrant and homestead.yaml files (for windows vendor\\bin\\homestead make) https://laravel.com/docs/7.x/homestead#per-project-installation
Configure the vagrant, homestead.yaml, and hosts file as you have done.
vagrant up

No input files specified - symfony app set up with homestead

I tried to use homestead to iset up Symfony using instruction here. Everything seemed to run correctly in git bash, but after php bin/console server:start, I get "No input files specified" when I go to localhost:8000 or http://127.0.0.1:8000 or symfony-demo.test. I have searched around and tried different approaches for the past 6 hours, but still can't get it work. I'm quite new to virtual machine and vagrant, and complete newbie to Symfony so any help would be highly appreciated!
Here is my Homestead.yaml file:
folders:
- map: C:\php-apps
to: /home/vagrant/code
sites:
# - map: homestead.test
# to: /home/vagrant/code/homestead/public
- map: symfony-demo.test
to: /home/vagrant/code/symfony_demo/web
type: symfony
Here is the host file:
#192.168.10.10 homestead.test
192.168.10.10 symfony-demo.test
Here is latest commands I ran in git bash:
vagrant#homestead:~$ ls
code
vagrant#homestead:~$ cd code/
vagrant#homestead:~/code$ cd symfony_demo/
vagrant#homestead:~/code/symfony_demo$ ls
symfony symfony-demo
vagrant#homestead:~/code/symfony_demo$ cd symfony-demo/
vagrant#homestead:~/code/symfony_demo/symfony-demo$ ls
app bin composer.json composer.lock phpunit.xml.dist README.md src tests var vendor web
vagrant#homestead:~/code/symfony_demo/symfony-demo$ php bin/console server:start
[OK] Server listening on http://127.0.0.1:8000
vagrant#homestead:~/code/symfony_demo/symfony-demo$
I tested Laravel before and it worked fine, though http://127.0.0.1:8000 was also showing laravel after started the symfony server in symfony-demo, so I commented out Laravel site in host file and Homestead.yaml and ran vagrant --provision. Afterwards when I went back to symfony-demo directory and launched the server again, everything starts to show "No input files specified".
I have figured it out so I want to post my solution here just in case someone else ran into the same issues as me. So I'm on a windows 10, before my own config files, please do read careful through these 3 resources:
Using homestead to install Symfony on various version documentation by Symfony
Installing Symfony 3 with vagrant and homestead by Sanket Patel
Set up homestead on windows by JBorbón
Here is what I did:
Create a homestead folder on my C drive.
Install symfony installer on C drive and move it into the homestead
folder above.
Create my project inside of homestead folder above (my project is
called autotrader).
Download vagrant, virtual box and set up homestead according to
their documentation. I set up a directory called
homesteadserver where I cloned homestead in.
Configure my Homestead.yaml file as below:
folders:
# - map: ~/code
# to: /home/vagrant/code
- map: C:\homestead
to: /home/vagrant/homestead
sites:
# - map: homestead.test
# to: /home/vagrant/code/public
- map: autotrader.test
to: /home/vagrant/homestead/autotrader/web
type: symfony
Configure my host file as below:
192.168.10.10 autotrader.test
Go to my homestead server and vagrant up and provision.

Laravel project is not opening in browser using Homestead

I know this question may be overlapping but I have tried most of all answers in online that I could find. But no success so far. So, anyone please help me out.
I am new to both Homestead and Laravel. This is my configuration and details about installation below:
Homestead 7 installed
Vagrant 2.0.3 installed
Composer 1.6.4 installed
Oracle VM VirtualBox 5.2.8 installed
git bash 2.16.1.windows.4 installed
Windows 10 O/S is my Main base O/S
On VirtualBox Manager I got these data=> Name: homestead-7, O/S: Ubuntu (64-bit), Base Memory: 2048 MB, Boot Order: Hard Disk, Optical, Acceleration: VT-x/AMD-V, Nested Paging, PAE/NX, KVM Paravirtualization..... so on
In c:/Laravel_P folder I installed Laravel using Composer in Git Bash:
cd /c/Laravel_P
composer create-project --prefer-dist laravel/laravel wetest
After about command, i got 26.3 MB wetest folder in Laravel_P folder, which was successful installation of Laravel.
Then I backdown from folders to my root by cd command and go to Homestead folder by cd Homestead. After I enter the Homestead folder, I run command:
vagrant up
This runs my Homestead Vagrant successfully (I checked in VB) and when processing this command no any error was shown.
I change my homestead.yaml file to this as my system placements.
authorize: C:/Users/my_user/.ssh/id_rsa.pub
keys:
- C:/Users/my_user/.ssh/id_rsa
folders:
- map: C:/Laravel_P
to: /home/vagrant/code
sites:
- map: homestead.wetest
to: /home/vagrant/code/wetest/public
Also changed my host file and saved the change:
127.0.0.1 localhost
::1 localhost
192.168.10.10 homestead.wetest
Then i run another command:
vagrant provision
I have tried also vagrant reload --provision command also
Now, when i tried to access my Laravel project from
http://homestead.wetest
I got Error:
This site can’t be reached
homestead.wetest’s server IP address could not be found.
In my knowledge, I tried every step as found in web and documentation in Laravel, but why am I not getting the desired result? Please anyone help me in this.
folders:
- map: C:/Laravel_P
to: /home/vagrant/code
sites:
- map: homestead.wetest
to: /home/vagrant/code/wetest/public
should be to: /home/vagrant/code/public

Installing multiple Laravel homestead machines

I was wondering how I would be able to run multiple versions of homestead without having VirtualBox crash.
I am currently running a default installation of the laravel homestead, but I need to install another custom one, which is customised to work with several proxies.
Just to be clear: I know how to run multiple sites. That is not the issue. I just want to run a second, custom version of the Laravel Homestead Vagrant box, while still having the possibility to run my normal one.
Details: I'm running Homestead v2.1.7 on Mac
Thanks in advance!
I know it's an old question, but the problem is still accurate.
There are some circumstances when you have to run two instances of homestead at the same time. For example when you have app that is works with apache, and one that is freaking out when you enable apache on a server. When you enable it on one website in Vagrant.yaml it will redirect every page that is not using apache to the site that is using it, see example:
- map: presta.shop
to: /home/vagrant/htdocs/presta-shop
type: apache
- map: my.app
to: /home/vagrant/htdocs/my-app
In this situation when you will call my.app homestead will redirect you to presta.shop - because this site is using apache (PrestaShop needs to run under apache). See this link: Github NGINX and Apache conflict #555
My my.app will crash with apache enabled, or I just don't want to enable it on this app, or I just need one extra server just for testing or something. You have to follow those steps from install homestead. After the installation of first server you need to:
run VirtualBox (or other machine you are using)
find and rename added homestead box (homestead), to what ever you wish ie: apache_homestead
go to homestead dir (cloned from git)
find file: Homestead.yaml
in Homestead.yaml add new line after provider with name (this is the name of your
renamed box apache_homestead in this case), and ip for let say: 192.168.10.11
in this file you can configure many settings, including name:
ip: "192.168.10.11"
memory: 3072
cpus: 1
provider: virtualbox
name: apache_homestead
After that You may change name of a dir where homestead clone is (default name is homestead). If you rename it to homestead_apache and run vagrant up from this directory you will have completely independent server.
To run "normal" server just follow the instructions from install homestead again and run as many servers as You wish :) Run any just go to it homestead directory and run vagrant up. Remember the limitation of your host machine!
IMPORTANT NOTE!
You can have all files for all servers in one dir, but every server has it's own database!!. So before you will move application to another server export and import it's database!

Automate the laravel homestead to reload my Homestead.yaml configurations

After installing the homestead and adding the box, and configured the Homestead.yaml that contains the url homestead.app
After doing an up and ssh, going to /etc/nginx/sites-enabled the homestead.app was there.
So I changed the homestead.app into site.daison.app in my Homestead.yaml from my hosts and doing a homestead halt and homestead up again and ssh just to reload my configurations as I thought.
Going back to the /etc/nginx/sites-enabled the homestead.app still remain.
So what I did is to destroy my homestead using the command homestead destroy and doing the up and ssh again going back to /etc/nginx/sites-enabled the config site.daison.app is now there.
Question:
Is there a way to do this and reload my homestead configurations instead of destroying it and doing things again and again?
Go to the directory where you homestead is created. Type in the terminal
vagrant provision
Homestead is just a predefined vagrant-box.
Documentation:
http://laravel.com/docs/4.2/homestead#daily-usage

Categories