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