Blog coding and discussion of coding about JavaScript, PHP, CGI, general web building etc.

Saturday, April 16, 2016

Using Laravel Homestead: 'no input file specified'

Using Laravel Homestead: 'no input file specified'


I am new to using Laravel, and Homestead, and would appreciate any help or a point in the right direction. I have successfully been able to get to the "You have arrived" screen when I run "php artisan serve" but when I try to do the same thing via Vagrant, I get "no input file specified". My Homestead.yaml file looks like this:

authorize: /Users/me/.ssh/id_rsa.pub    keys:      - /Users/me/.ssh/id_rsa    folders:      - map: /Users/me/code/exampleproject        to: /home/vagrant/code/exampleproject    sites:      - map: exampleproject.app        to: /home/vagrant/code/exampleproject/public    variables:      - key: APP_ENV        value: local  

On my computer I have the following directories:

/Users/me/code/Homestead  /Users/me/code/exampleproject //this is the directory created with composer  

On my Vagrant Box I have for some reason two directories named "code" and "Code":

/home/vagrant/code/exampleproject   /home/vagrant/Code  

I have checked and I can see changes made to my computer exampleproject files are reflected in the vagrant box files.

Not really sure how to figure this out!! I would really appreciate any help possible :)

Answer by noeldiaz for Using Laravel Homestead: 'no input file specified'


Word of caution, linux is case sensitive. That is probably why you see a "Code" and a "code" directory.

What I would do is redo the vagrant setup again and if you want to keep it simple and matching what the Homestead box has as a default make your directory in your host machine "Code" with uppercase.

You could also in the "folders" section just map to your "Code" folder in your machine, in case you decide to add more sites to your Homestead setup later. That way under /home/vagrant/Code/ you will see all your site projects and you can ass more sites pointing to their "public" directories.

Answer by Sleiman Antoin Sleiman for Using Laravel Homestead: 'no input file specified'


Instead of reinstalling try

vagrant up --provision

or

homestead up --provision

Answer by Senthil for Using Laravel Homestead: 'no input file specified'


Giving my response just in case if anybody struggling with this issue.

  1. You might need to verify that the server.root configuration in "/etc/ngnx/sites-available/domain" matching with your sites.to config in "Homestead.yaml".

  2. If its not matching then change it and restart the webserver with "sudo service nginx restart"

  3. And still things are not working then allow write permission for the "YOURSITE/app/storage" folder as "chmod -R 777 app/storage"

Answer by Arda for Using Laravel Homestead: 'no input file specified'


I also had the same problem, I had assumed that Laravel is installed "out of the box" but it seems it isn't. I SSH'ed to the machine and ran these commands:

cd Code  sudo composer self-update #not necessary, but I did it anyways  composer create-project laravel/laravel Laravel --prefer-dist  

And everything was running as usual.

Answer by Truc Truong for Using Laravel Homestead: 'no input file specified'


This is easy to fix, because you have changed the folder name to: exampleproject

So SSH to your vagrant:

ssh vagrant@127.0.0.1 -p 2222  

Then change your nginx config:

sudo vi /etc/nginx/sites-enabled/homestead.app

Edit the correct URI to the root on line 3 to this with the new folder name:

root "/Users/MYUSERNAME/Code/exampleproject/public";  

Restart Nginx

sudo service nginx reload  

Reload the web browser, it should work now

Answer by Rudy Jessop for Using Laravel Homestead: 'no input file specified'


I had the same exact problem and found the solution through the use of larachat.

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.

He also discussed what I explained in this series https://laracasts.com/series/laravel-5-fundamentals/

Answer by Rayzor for Using Laravel Homestead: 'no input file specified'


This issue occurred for me after editing the Homestead.yaml. I resolved this issue by

homestead destroy  homestead up  

Answer by Selassie Twumasi for Using Laravel Homestead: 'no input file specified'


Restart your homestead. Worked for me.

homestead destroy  homestead up  

Answer by 2upmedia for Using Laravel Homestead: 'no input file specified'


This is likely because the nginx web server is not pointing to the right path.

There's two keys that you should look at: the map key under folders and the to key under sites. The folders key maps folders on your local machine to the vagrant VM. The sites key is used to create a virtual host on nginx with the value in to.

What you want to make sure is that to under sites points to the right path to public.

The problem was that I created my laravel project with composer create laravel/laravel. This created a folder in my current directory named laravel. Then without changing directories I installed the homestead helper with composer require laravel/homestead --dev.

After running php vendor/bin/homestead make and vagrant up my directory structure looked something like this:

$ cd laravel51  $ ls -a  .  ..  .vagrant  laravel  composer.json  composer.lock  vendor  Homestead.yml  Vagrantfile   

My Homestead.yml looked like this:

folders:      - map: "/Users/USER/Sites/sandbox/php/laravel51"        to: "/home/vagrant/laravel51"    sites:      - map: laravel51        to: "/home/vagrant/laravel51/public"  

If you look closely, the /Users/USER/Sites/sandbox/php/laravel51 path will be mounted onto the vagrant VM. This is the wrong directory because it should be pointing to the laravel project root where your app directory is. What happened here was that I was supposed to require the homestead helper while I was in the project root.

So now the question is what do I do? You've got two options: get rid of your current homestead VM and start over, but this time from the project root OR salvage what you have already.

If you want to salvage what you have, you'll have to move several files and a folder to your laravel project root.

These are the artifacts you'll need to move:

.vagrant  Homestead.yml  Vagrantfile  

The composer.json won't be needed since you'll be requiring it later.

Move those files to your laravel project root and change your current working directory to there (cd laravel). At that point just update the map under folders and make sure that it's pointing to the project root. Also make sure that the to key under sites is the to key under folders with /public appended to it.

For example:

folders:      - map: "/Users/USER/Sites/sandbox/php/laravel51/laravel"        to: "/home/vagrant/laravel51"    sites:      - map: laravel51        to: "/home/vagrant/laravel51/public"  

Now run composer require laravel/homestead --dev so that the homestead helper is required into your current project's composer.json file and installed.

Run vagrant reload --provision and you should be all set.

Answer by EvWill for Using Laravel Homestead: 'no input file specified'


In Laravel 5 I had to ssh into my homestead server and run these commands:

sudo chmod -R 777 storage  sudo chmod -R 777 bootstrap/cache  

Answer by Matt Pierce for Using Laravel Homestead: 'no input file specified'


Here's my solution:

It's a file path problem so below are my folders & sites paths. Also, I had to use "vagrant destroy" as provisioning didn't work.

enter image description here

Answer by Mahmoud Zalt for Using Laravel Homestead: 'no input file specified'


This usually happens when you edit the Homestead.yaml file.

If like me you tried homestead up --provision and didn't worked! then try this (it works for me):

  • homestead destroy
  • homestead up

Answer by Angel Noriega for Using Laravel Homestead: 'no input file specified'


My problem was in the config file of the domain:

the public folder of my project was created in /home/vagrant/Code/demo/public

the config file of the domain (for me /etc/nginx/sites-available/demo.app) had configured: "/home/vagrant/Code/Laravel/public" instead of "/home/vagrant/Code/demo/public".

Now it is working perfect.

Answer by ar_massum for Using Laravel Homestead: 'no input file specified'


I have had similar issues with Homestead and just provisioning the box worked for me. So you should try this:

vagrant provision

Answer by aljaydavids for Using Laravel Homestead: 'no input file specified'


I had the same issue while following the Laravel docs (https://laravel.com/docs/5.2/homestead)

My problem was very simple, I missed read this part in the docs:

Homestead.yaml file will be placed in the ~/.homestead hidden directory:

So I was updating the wrong Homestead.yaml file, since the file was moved when I ran the bash init.sh command.

I only realised this after a lot of searching, so hope this will help someone.


Fatal error: Call to a member function getElementsByTagName() on a non-object in D:\XAMPP INSTALLASTION\xampp\htdocs\endunpratama9i\www-stackoverflow-info-proses.php on line 72

  1 comment:

  1. Laravel Development Company: ExpressTech Software Solutions offering Custom Laravel Development Services like Laravel RESTful API Development with Integration solution. +91-9806724185 or Contact@expresstechsoftwares.com

    ReplyDelete

Popular Posts

Powered by Blogger.