Laravel 不显示 index.php

Laravel not showing index.php(Laravel 不显示 index.php)
本文介绍了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的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!

本站部分内容来源互联网,如果有图片或者内容侵犯您的权益请联系我们删除!

相关文档推荐

Convert JSON integers and floats to strings(将JSON整数和浮点数转换为字符串)
in php how do I use preg replace to turn a url into a tinyurl(在php中,如何使用preg替换将URL转换为TinyURL)
all day appointment for ics calendar file wont work(ICS日历文件的全天约会不起作用)
trim function is giving unexpected values php(Trim函数提供了意外的值php)
Basic PDO connection to MySQL(到MySQL的基本PDO连接)
PHP number_format returns 1.00(Php number_Format返回1.00)