如何让我的 laragon 服务器开始使用 http://localhost 而不是 file:///

How to let my laragon server to start using http://localhost instead of file:///

我刚刚下载了 largon 作为我的 php 项目的服务器。现在我发现很难让我的文件采用 localhost:/test.php 而不是 file://test.php 的形式。当它使用 file:// 时,我的所有代码都不会在浏览器中 运行 时执行,而是显示为在浏览器的编辑器中编写。

谁能指导我如何将 file:// 切换为 localhost:/

谢谢。

@Adetona77: 如果您的 www 文件夹包含文件夹名称 adetona 和文件名称 test.php 像这样:

www 
---test.php 
---adetona

使用 Laragon,您可以通过以下方式访问 test.php
http://localhost/test.php

对于文件夹 adetona,您有 2 个选项:

  1. 通过本地主机访问: http://localhost/adetona

  2. 通过 pretty url 访问: http://adetona.dev

选项2是Laragon的强大功能