Laravel not showing index.php

后端 未结 3 767
萌比男神i
萌比男神i 2021-01-14 01:53

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

3条回答
  •  失恋的感觉
    2021-01-14 02:26

    This is your VirtualHost setup

    
        DocumentRoot "C:/xampp/htdocs/example" ## <-- pointed to wrong folder
        ServerName example.com
        ServerAlias www.example.com 
        ErrorLog "logs/www.example.com.domain-error.log"
    
    

    You didn't point it to the public folder. It should be (These are minimum requirements)

    
        DocumentRoot "C:/xampp/htdocs/example/public"
        ServerName example.com
    
    

    You should point it to the public folder because index.php is inside public folder.

    I use this kind of setup

    
        DocumentRoot "D:/xampp/htdocs/laravel4/public"
        ServerName laravel4.dev
    
    

    Corresponding setup in windows/system32/drivers/etc/host file is

    127.0.0.2           ci.dev
    127.0.0.3           laravel4.dev ## <-- This is for current vHost
    127.0.0.4           symcom.dev
    

    So, I can navigate to my site on local host using http://laravel4.dev (dev for development)

提交回复
热议问题