You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

Windows系统下VS Code中/var/www/html/目录位置查询及PHP Live Server配置问题

Windows下VS Code中对应/var/www/html的目录位置说明

Hey there! Let's clear up this confusion—/var/www/html is the default web root directory for Apache on Linux systems, so it doesn't exist natively on Windows. The equivalent path depends on what setup you're using with Live Server and your PHP environment:

  • If you're using XAMPP: The default web root folder is C:\xampp\htdocs. This is the Windows version of /var/www/html for XAMPP's Apache server.
  • If you're using WAMP: Look for C:\wamp64\www (use C:\wamp\www if you have the 32-bit version installed).
  • If you're just using VS Code's Live Server plugin (no local Apache/Nginx): Live Server uses the folder you currently have open in VS Code as its root by default. To customize this:
    1. Open VS Code settings (press Ctrl + , on your keyboard)
    2. Search for Live Server: Root
    3. Enter the full path to your desired web root folder (e.g., C:\my-web-projects\public)

If you're following that PHP configuration method from the post, make sure your PHP environment's web root matches the folder you set in Live Server—this way your PHP files will be served correctly without path issues.

内容的提问来源于stack exchange,提问作者samuelhertrich

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.04.30 04:07:44