Laravel没有显示index.php [英] Laravel not showing index.php

查看:379
本文介绍了Laravel没有显示index.php的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是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.phppublic文件夹内.

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的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆