You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

Ubuntu 17.10部署Laravel时Homestead.test显示No input file specified求助

Fixing "No input file specified" with Laravel Homestead on Ubuntu 17.10

Hey there, let's tackle that "No input file specified" error you're seeing when trying to access Homestead.test. I've dealt with this exact issue a few times, so let's walk through the most likely fixes step by step:

1. Double-check your Homestead.yaml site mapping

Even though you said you didn't modify the file, it's worth confirming the path to your Laravel project's public folder is correct. Open your Homestead.yaml file (usually in ~/Homestead/) and look for the sites section:

sites:
    - map: homestead.test
      to: /home/vagrant/code/public

Make sure your local Laravel project is stored in ~/code (so the public folder is at ~/code/public). If your project is in a different directory (like ~/projects/my-laravel-site), update the to value to /home/vagrant/projects/my-laravel-site/public, then run:

vagrant reload --provision

2. Verify the Nginx site configuration in the VM

Sometimes the auto-generated Nginx config has mismatched paths. SSH into your Homestead box first:

vagrant ssh

Then check the site config file:

sudo nano /etc/nginx/sites-available/homestead.test

Ensure the root directive points to the correct public folder inside the VM, like:

root /home/vagrant/code/public;

If you make changes, save the file (Ctrl+O, then Enter) and restart Nginx:

sudo service nginx restart

3. Stop XAMPP's Apache service

You mentioned running XAMPP—Apache uses port 80, which Homestead relies on by default. If Apache is using port 80, Homestead can't serve your site properly. Open the XAMPP control panel, stop the Apache service, then restart Homestead:

vagrant reload

4. Confirm your project files are synced to the VM

It's possible your local project files aren't being synced to the Homestead VM. SSH into the VM and check the mapped directory:

vagrant ssh
cd /home/vagrant/code
ls -la

If you don't see your Laravel project files here, double-check the folders section in Homestead.yaml:

folders:
    - map: ~/code
      to: /home/vagrant/code

Ensure your local ~/code folder contains your Laravel project, then re-provision to sync the folders:

vagrant reload --provision

5. Clear Laravel's cache (if your project exists in the VM)

If your files are present but you still get the error, cached configuration paths might be causing issues. From within your project directory in the VM:

php artisan cache:clear
php artisan config:clear

6. Check your Ubuntu hosts file

Make sure your local hosts file maps Homestead.test to Homestead's IP address. Open the hosts file with:

sudo nano /etc/hosts

Look for a line like this—add it if it's missing:

192.168.10.10 homestead.test

Save the file and try accessing the site again.


内容的提问来源于stack exchange,提问作者Khrisna Gunanasurya

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.05.20 07:22:29