index.php 文件无法使用 Live Server VS Code 扩展、Live Server Web 扩展和 PHP Server VS Code 扩展进行实时重新加载

问题描述 投票:0回答:1

我正在尝试使用三种不同的工具使我的index.php文件实时重新加载:Live Server VS Code扩展名称:Live Server ID: ritwickdey.LiveServer 描述:启动具有静态和动态页面实时重新加载功能的开发本地服务器 版本:5.7.9 发行商: Ritwick Dey VS Marketplace 链接:https://marketplace.visualstudio.com/items?itemName=ritwickdey.LiveServer)、Live Server Chrome 扩展 (https://chromewebstore.google.com/detail/live-server) -web-extension/fiegdmejfepffgpnejdinekhfieaogmj),以及 PHP Server VS Code 扩展名称:PHP Server ID:brapifra.phpserver 描述:使用 PHP 为您的项目提供服务 版本:3.0.2 发行商: brapifra VS Marketplace 链接:https://marketplace.visualstudio.com/items?itemName=brapifra.phpserver).

我在Live Server Chrome扩展中的“Live Server地址”输入中输入Live Server VS Code扩展服务器地址(http://127.0.0.1:64193/)以及PHP服务器地址(http ://localhost:3000/index.php) 在 Live Server Chrome 扩展中的“实际服务器地址”输入中,但没有发生实时重新加载。

我在 macOS Big Sur 11.7.10 (20G1427) 上安装了 PHP 版本 7.3.29。我的机器是 MacBook Pro(Retina,15 英寸,2014 年中)。

php google-chrome visual-studio-code liveserver
1个回答
0
投票

您不需要使用所有这些扩展。只需在 VS Code 中使用 Live Server 扩展就足够了。您可以通过搜索名称来在设置中找到该扩展程序,然后为其设置您的首选浏览器。然后,按下VS Code下面的按钮,就可以运行它了。您对 index.html 所做的任何更改并保存后都会立即向您显示所做的更改。 您还可以在搜索到的相同设置中找到您想要的设置,例如,您可以设置您想要的端口。

在此输入图片描述

© www.soinside.com 2019 - 2024. All rights reserved.