方法一:

  • 1 打开 应用程序->XAMPP->xamppfiles->etc->httpd.conf 文档
  • commond+f搜索htdocs,搜到如下结果
# DocumentRoot: The directory out of which you will serve your
# documents. By default, all requests are taken from this directory, but
# symbolic links and aliases may be used to point to other locations.
#
DocumentRoot "/Applications/XAMPP/xamppfiles/htdocs"
<Directory "/Applications/XAMPP/xamppfiles/htdocs">
  • 3 修改DocumentRoot和Directory中的路径为你想要的路径,两个的路径要一样

方法二:

  打开xampp -> Manage Servers -> Apache Web Server -> Configure -> Open Conf File ,之后同方法1的第二步

修改完之后在终止apache服务的时候可能会出现如下错误:

Stopping Apache Web Server...
Exit code: 8
Stdout:
apache config test fails, aborting
Stderr:
AH00526: Syntax error on line 229 of /Applications/XAMPP/xamppfiles/etc/httpd.conf:
DocumentRoot '/Applications/XAMPP/xamppfiles/\xe2\x80\x9c/Users/****/PhpstormProjects\xe2\x80\x9c' is not a directory, or is not readable

可以看到其中出现  \xe2\x80\x9c  的错误,主要是由于在修改DoucmentRoot时出现中文引号的原因,

“/Users/mac-user/Sites/domain/httpdocs”
This should be:
"/Users/mac-user/Sites/domain/httpdocs"

可参考

https://stackoverflow.com/questions/27843813/apache-prefixing-path-to-virtual-hosts-path

https://stackoverflow.com/questions/22951499/mac-os-x-xampp-access-forbidden

最新文章

  1. 浅谈HTTP请求头content-type
  2. PHP面向对象学习三 类的抽象方法和类
  3. win7添加鼠标右键关联
  4. Git 文件比较
  5. Quoted-printable 编码介绍、编码解码转换
  6. word2vec使用说明
  7. English article1
  8. Unity3d Shortcuts
  9. 有趣的js题目
  10. [006]为什么C++会被叫做是C++?
  11. angularjs ios title不能修改的bug的解决方法
  12. 适合自己的vim配置文件
  13. 【设计模式 - 5】之适配器模式(Adapter)
  14. OpenRisc-47-or1200的WB模块分析
  15. 使用JavaScript重定向URL参数
  16. 高可用Redis(十):Redis原生命令搭建集群
  17. 最全的.NET Core跨平台微服务学习资源没有之一
  18. DIY一些基于netty的开源框架
  19. Netty学习(八)-Netty的心跳机制
  20. Windows把内存变成快速虚拟硬盘

热门文章

  1. mongo常用sql
  2. SearchView监听关闭正确方案
  3. redis客户端(三)
  4. keras图像风格迁移
  5. QWaitConditioin的思考1
  6. Debug程序的使用
  7. JVM 性能调优 -Xmx、-Xms、-Xss
  8. vue 使用canvas仿芝麻分信用表
  9. jirba库的使用和好玩的词云
  10. 引擎设计跟踪(九.14.2j) TableView工具填坑以及多国语言