Laravel not showing 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.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的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:Laravel 不显示 index.php
				
        
 
            
        - SoapClient 设置自定义 HTTP Header 2021-01-01
 - PHP Count 布尔数组中真值的数量 2021-01-01
 - 没有作曲家的 PSR4 自动加载 2022-01-01
 - 正确分离 PHP 中的逻辑/样式 2021-01-01
 - Mod使用GET变量将子域重写为PHP 2021-01-01
 - 如何定位 php.ini 文件 (xampp) 2022-01-01
 - 带有通配符的 Laravel 验证器 2021-01-01
 - Oracle 即时客户端 DYLD_LIBRARY_PATH 错误 2022-01-01
 - Laravel 仓库 2022-01-01
 - 从 PHP 中的输入表单获取日期 2022-01-01
 
				
				
				
				