问题描述
我是 Laravel 的新手,我做了虚拟主机 http://example.com 并将 Laravel 安装在这个域,但是当我尝试访问这个域时,我得到了这个
I'm new in Laravel, I made virtual host http://example.com and installed Laravel in folder of this domain but when I try to access this domain I get this
推荐答案
这是你的 VirtualHost
设置
<VirtualHost *:80>
DocumentRoot "C:/xampp/htdocs/example" ## <-- pointed to wrong folder
ServerName example.com
ServerAlias www.example.com
ErrorLog "logs/www.example.com.domain-error.log"
</VirtualHost>
您没有将其指向 public
文件夹.应该是(这些是最低要求)
You didn't point it to the public
folder. It should be (These are minimum requirements)
<VirtualHost *.80>
DocumentRoot "C:/xampp/htdocs/example/public"
ServerName example.com
</VirtualHost>
您应该将它指向 public
文件夹,因为 index.php
在 public
文件夹中.
You should point it to the public
folder because index.php
is inside public
folder.
我使用这种设置
<VirtualHost laravel4.dev>
DocumentRoot "D:/xampp/htdocs/laravel4/public"
ServerName laravel4.dev
</VirtualHost>
windows/system32/drivers/etc/host
文件中对应的设置是
127.0.0.2 ci.dev
127.0.0.3 laravel4.dev ## <-- This is for current vHost
127.0.0.4 symcom.dev
因此,我可以使用 http://laravel4.dev
(dev
用于开发)导航到本地主机上的站点
So, I can navigate to my site on local host using http://laravel4.dev
(dev
for development)
这篇关于Laravel 不显示 index.php的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!