mac 配置 apache

August 20, 2022

如何在 mac 下配置 php 运行环境

1、打开 httpd.conf 配置

以下是使用 vscode 打开

code /etc/apache2/httpd.conf

2、修改 httpd.conf 配置文件

<Directory />
  AllowOverride none
  Require all denied
</Directory>

DocumentRoot "/Users/mymac/Desktop/Project"
<Directory "/Users/mymac/Desktop/Project">
  Options FollowSymLinks Multiviews
  MultiviewsMatch Any
  AllowOverride None
  Require all granted
</Directory>

3、检查配置目录的读写权限

apache 1

4、启动 appache 就行

# 启动
sudo apachectl start
# 重启
sudo apachectl restart

5、本地访问

http://localhost/


Profile picture

Written by Vance who lives and works in Shenzhen, China, and is working hard to improve. You should follow them on csdn