laravel 为什么我的 Vagrant 框中出现错误 500?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/25478188/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Why am I getting error 500 in my Vagrant box?
提问by Chris Farrugia
I'm trying to get Vagrant set up for Laravel development and am trying to use Jeffrey Way's bootstrap.sh (https://raw.githubusercontent.com/JeffreyWay/Vagrant-Setup/master/install.sh) to get my environment set up.
我正在尝试为 Laravel 开发设置 Vagrant,并尝试使用 Jeffrey Way 的 bootstrap.sh ( https://raw.githubusercontent.com/JeffreyWay/Vagrant-Setup/master/install.sh) 来设置我的环境向上。
The problem is that after running vagrant up, I go to localhost:8080/ and it tries to redirect to localhost:8080/html and throws an error 500 Internal Server error. Any idea why that would be?
问题是在运行 vagrant 之后,我转到 localhost:8080/ 并尝试重定向到 localhost:8080/html 并抛出错误 500 Internal Server error。知道为什么会这样吗?
Here is my VagrantFile
这是我的 VagrantFile
# -*- mode: ruby -*-
# vi: set ft=ruby :
# Vagrantfile API/syntax version. Don't touch unless you know what you're doing!
VAGRANTFILE_API_VERSION = "2"
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
config.vm.box = "precise32"
config.vm.box_url = "http://files.vagrantup.com/precise32.box"
config.vm.network :forwarded_port, guest: 80, host:8080
config.vm.provision :shell, :path => "bootstrap.sh"
end
回答by Rubendob
Recenlty I had the same issue and the problem was, in my case, that Virtual Host was pointing to /vagrant folder and this folder is owned by vagrant.vagrant. I changed Document Root to /var/www/ (default) and this change fix the issue. Review the rights of the folder of the Document Root of your apache. Hope this helps.
最近我遇到了同样的问题,问题是,就我而言,虚拟主机指向 /vagrant 文件夹,而该文件夹归 vagrant.vagrant 所有。我将 Document Root 更改为 /var/www/(默认),此更改解决了该问题。查看 apache 的 Document Root 文件夹的权限。希望这可以帮助。