Laravel Sail - Why do I get the laravel project directory when I access the localhost?

Viewed 140

this is a fresh install laravel app. Any idea why it shows the project directory instead of the laravel welcome view when accessing http://localhost in the browser?

What I've tried:

  • I've restarted the app several times.
  • I also try to use laravel built-in server by running sail php artisan serve but no luck.

What I haven't tried:

  • Check apache2 configuration

http://localhost

Should I also file this to the laravel repository on Github?

2 Answers

you should have file name vhosts or something like that in config

<VirtualHost *:80>
DocumentRoot "C:/xampp/htdocs/"  ->here put your root projects like this
ServerName localhost
</VirtualHost>

In Ubuntu it is /etc/hosts. You can edit the file as same in other OSes

you need to write something like that

    127.0.0.1       localhost

hopefully that is help you

You should map your site to the public folder in html. In apache you do this in a .conf file inside /sites-available.

Related