最近我安装了laravel 5.2,但我的主页没有显示在"localhost"地址。它显示在"localhost/public"地址。我已经安装了htdocs文件夹中的所有文件。为什么会出现这种"公开"的东西?
假设您在默认位置安装了examplep,那么httpd.conf文件应该在这里可用:
C: ''axamp''apache''conf''httpd.conf
查找2条相邻线路:
DocumentRoot "C:/xampp/htdocs"
<Directory "C:/xampp/htdocs">
并将它们更改为指向laravel的公用文件夹:
DocumentRoot "C:/xampp/htdocs/public"
<Directory "C:/xampp/htdocs/public">
我觉得这个教程很有帮助。
https://www.youtube.com/watch?v=ybJYyU5FPv4
只需像上面提到的那样,用正确的文档根为页面设置一个vhost。但你不需要像处理默认的网络项目一样处理Laravel项目。通过项目文件夹中的控制台使用php artisan serve
,页面将以默认localhost:8000
运行。