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/htmlfor XAMPP's Apache server. - If you're using WAMP: Look for
C:\wamp64\www(useC:\wamp\wwwif 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:
- Open VS Code settings (press
Ctrl + ,on your keyboard) - Search for
Live Server: Root - Enter the full path to your desired web root folder (e.g.,
C:\my-web-projects\public)
- Open VS Code settings (press
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
相关产品推荐
相关产品推荐

