Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

PHP

Laravel problem : "No file input specified" [Resolved]

Hello,

I have been several hours since this morning with the installation of Laravel on Linux - in my case.

I have followed the instructions with the tutorial, installed Nginx, Vagrant, Virtual Box and Laravel with Composer in the specified folders and here is an overview of my Homestead.yaml :

ip: "10.0.10.10" memory: 500 cpus: 1

authorize: /home/lukas90/.ssh/id_rsa.pub

keys: - /home/lukas90/.ssh/id_rsa

folders: - map: /home/lukas90/Treehouse/Laravel/Homestead/Projects to: /home/lukas90/vagrant/Sites

sites: - map: homestead.dev #laravel.dev to: /home/lukas90/vagrant/Sites/laravel-basics/public

variables: - key: APP_ENV value: local

I also restarted Vagrant several times with the provision option, connected with SSH and changed the hosts file in the /etc folder.

But I always have the same message when I type http://laravel:8000/ or http://localhost:8000/ : "No input file specified.".

I also searched in Google for solutions, but none worked or I don't understand anything. I'm not really at ease with system programming compared to web development.

I spent all the morning and nearly the afternoon to solve this problem, but without success. I'm really fed up and I'm starting to think if I couldn't learn how to develop with Laravel. Even the installation of Symfony was so easier.

I also installed Laravel directly in my Xampp folder with my other previous PHP projects working with an Apache Server, but none index page displays at screen but online a list of files.

Thanks a lot in advance for your help.

5 Answers

There might be something going wrong with the permissions, so running as root /with sudo might help you out. This post mentions linux is case sensitive.

Hey!

That sucks, it sounds like a nightmare. Have you tried with the original ip address in Homestead.yaml?

I would make absolutely, 100% sure that every single one of these filepaths is pointing to the right location. I think you also have to be conscious of indentation in a .yaml file, but I may have made that up.

folders: 
-  map: /home/lukas90/Treehouse/Laravel/Homestead/Projects 
   to: /home/lukas90/vagrant/Sites

sites: 
-  map: homestead.dev #laravel.dev 
   to: /home/lukas90/vagrant/Sites/laravel-basics/public

Here's mine - I can see a difference in the filepaths of

  • folders: to: and
  • sites: to:

Maybe you're incorrectly looking inside the lukas90 folder? I don't know how Linux works, I'm on Mac.

folders:
    - map: /Users/Tom/Homestead/Projects
      to: /home/vagrant/Sites   

sites:
    - map: laravel-basics.dev
      to: /home/vagrant/Sites/laravel-basics/public   
    - map: project-one.dev
      to: /home/vagrant/Sites/project-one/public
    - map: project-two.dev
      to: /home/vagrant/Sites/project-two/public

Hello,

I checked my Homestead.yaml and it's not a problem of identation. I also moved the vagrant folder to /home directly and changed the values of the same file like this :


ip: "192.168.10.10" memory: 512 cpus: 1

authorize: /home/lukas90/.ssh/id_rsa.pub

keys: - /home/lukas90/.ssh/id_rsa

folders: - map: /home/lukas90/Treehouse/Laravel/Homestead/Projects to: /home/vagrant/Sites

sites: - map: laravel-basics.dev to: /home/vagrant/Sites/laravel-basics/public

variables: - key: APP_ENV value: local

I also reloaded vagrant in the Homestead directory and here are the results :

[lukas90@Lukas90 Homestead]$ vagrant reload --provision ==> default: Attempting graceful shutdown of VM... ==> default: Checking if box 'laravel/homestead' is up to date... ==> default: Clearing any previously set forwarded ports... ==> default: Clearing any previously set network interfaces... ==> default: Preparing network interfaces based on configuration... default: Adapter 1: nat default: Adapter 2: hostonly ==> default: Forwarding ports... default: 80 => 8000 (adapter 1) default: 3306 => 33060 (adapter 1) default: 5432 => 54320 (adapter 1) default: 22 => 2222 (adapter 1) ==> default: Running 'pre-boot' VM customizations... ==> default: Booting VM... ==> default: Waiting for machine to boot. This may take a few minutes... default: SSH address: 127.0.0.1:2222 default: SSH username: vagrant default: SSH auth method: private key default: Warning: Connection timeout. Retrying... default: Warning: Connection timeout. Retrying... default: Warning: Remote connection disconnect. Retrying... default: Warning: Remote connection disconnect. Retrying... ==> default: Machine booted and ready! ==> default: Checking for guest additions in VM... default: The guest additions on this VM do not match the installed version of default: VirtualBox! In most cases this is fine, but in rare cases it can default: prevent things such as shared folders from working properly. If you see default: shared folder errors, please make sure the guest additions within the default: virtual machine match the version of VirtualBox you have installed on default: your host and reload your VM. default: default: Guest Additions Version: 4.3.10 default: VirtualBox Version: 4.2 ==> default: Setting hostname... ==> default: Configuring and enabling network interfaces... ==> default: Mounting shared folders... default: /vagrant => /home/lukas90/Treehouse/Laravel/Homestead default: /home/vagrant/Sites => /home/lukas90/Treehouse/Laravel/Homestead/Projects ==> default: Running provisioner: shell... default: Running: inline script ==> default: stdin: is not a tty ==> default: ssh-rsa xxxxxx ==> default: Running provisioner: shell... default: Running: inline script ==> default: Running provisioner: shell... default: Running: inline script ==> default: stdin: is not a tty ==> default: Running provisioner: shell... default: Running: inline script ==> default: stdin: is not a tty ==> default: * Restarting nginx nginx ==> default: ...done. ==> default: php5-fpm stop/waiting ==> default: php5-fpm start/running, process 1960 ==> default: Running provisioner: shell... default: Running: inline script ==> default: stdin: is not a tty ==> default: php5-fpm stop/waiting ==> default: php5-fpm start/running, process 2082

I also checked my homestead.rb :

class Homestead def Homestead.configure(config, settings) # Configure The Box config.vm.box = "laravel/homestead" config.vm.hostname = "homestead"

# Configure A Private Network IP
config.vm.network :private_network, ip: settings["ip"] ||= "192.168.10.10"

# Configure A Few VirtualBox Settings
config.vm.provider "virtualbox" do |vb|
  vb.customize ["modifyvm", :id, "--memory", settings["memory"] ||= "512"] # 2048
  vb.customize ["modifyvm", :id, "--cpus", settings["cpus"] ||= "1"]
  vb.customize ["modifyvm", :id, "--natdnsproxy1", "on"]
  vb.customize ["modifyvm", :id, "--natdnshostresolver1", "on"]
end

# Configure Port Forwarding To The Box
config.vm.network "forwarded_port", guest: 80, host: 8000
config.vm.network "forwarded_port", guest: 3306, host: 33060
config.vm.network "forwarded_port", guest: 5432, host: 54320

# Configure The Public Key For SSH Access
config.vm.provision "shell" do |s|
  s.inline = "echo $1 | tee -a /home/vagrant/.ssh/authorized_keys"
  s.args = [File.read(File.expand_path(settings["authorize"]))]
end

# Copy The SSH Private Keys To The Box
settings["keys"].each do |key|
  config.vm.provision "shell" do |s|
    s.privileged = false
    s.inline = "echo \"$1\" > /home/vagrant/.ssh/$2 && chmod 600 /home/vagrant/.ssh/$2"
    s.args = [File.read(File.expand_path(key)), key.split('/').last]
  end
end

# Copy The Bash Aliases
config.vm.provision "shell" do |s|
  s.inline = "cp /vagrant/aliases /home/vagrant/.bash_aliases"
end

# Register All Of The Configured Shared Folders
settings["folders"].each do |folder|
  config.vm.synced_folder folder["map"], folder["to"], type: folder["type"] ||= nil
end

# Install All The Configured Nginx Sites
settings["sites"].each do |site|
  config.vm.provision "shell" do |s|
      s.inline = "bash /vagrant/scripts/serve.sh $1 $2"
      s.args = [site["map"], site["to"]]
  end
end

# Configure All Of The Server Environment Variables
if settings.has_key?("variables")
  settings["variables"].each do |var|
    config.vm.provision "shell" do |s|
        s.inline = "echo \"\nenv[$1] = '$2'\" >> /etc/php5/fpm/php-fpm.conf && service php5-fpm restart"
        s.args = [var["key"], var["value"]]
    end
  end
end

end end

I also wandered if it was necessary to use vagrant in root mode on the console. It means after typing "sudo su" and entering the admin password.

I always have the same message "No input file specified.".

I prefered to install Laravel without a virtual simple. I find it's much easier. But thanks anyway.

David Jarrin
PLUS
David Jarrin
Courses Plus Student 11,182 Points

Don't know if this is of any help to anyone but what seemed to fix the problem for me was making sure all of my file paths were correct in the yaml file, if one of them was incorrect and I had already started the vagrant up, destroy that vagrant and run vagrant up again.... Then I got to the larval start screen.

Woah! I would use vagrant destroy very sparingly! It totally kills everything :o

If you've made a change to the yaml file, you just need to run 'vagrant provision'