XMAPP Alias别名配置在windows上简单很,网上很多方法都可以实现,但是在 mac上面 一直都是403没有权限,这个问题困扰了1天,最后在同事(linux大神)的帮助下,终于解决了这个蛋疼的问题,让用Mac的小白们,也能方便的使用Mac开发PHP程序。废话不多说直接上步骤
XAMPP官方下载地址:https://www.apachefriends.org/zh_cn/index.html
操作步骤
1.安装好Mac最新的XAMPP。
2.配置etc/extra/httpd-xampp.conf
修改成 把下面的local修改成 all granted
<LocationMatch “^/(?i:(?:xampp|security|licenses|phpmyadmin|webalizer|server-status|server-info))”>
#Require local
Require all granted
ErrorDocument 403 /error/XAMPP_FORBIDDEN.html.var
</LocationMatch>
3.配置etc/httpd.conf
添加下面别名 由于tmp文件所有用户有权限范围,直接配置下面就可以访问tmp目录,但是其他的目录还是会受到权限问题。
Alias /abcd/ “/tmp/aaa/”
<Directory “/tmp/aaa/”>
Options Indexes MultiViews
Require all granted
</Directory>
Alias /php “/Users/jason/Documents/php_workspace”
<Directory “/Users/jason/Documents/php_workspace”>
Options Indexes MultiViews
Require all granted
</Directory>
4.修改Apache的启动用户
通过命令 id jason找到jason的所在组,修改成下面对应的内容。
也可以把/Users/jason/Documents/php_workspace这个目录赋值给默认用户访问权限(没有亲测)。
<IfModule unixd_module>
#
# If you wish httpd to run as a different user or group, you must run
# httpd as root initially and it will switch.
#
# User/Group: The name (or #number) of the user/group to run httpd as.
# It is usually good practice to create a dedicated user and group for
# running httpd, as with most system services.
#
User jason
Group staff
</IfModule>
5.测试ok
终于可以安心睡好觉了……
请注明转载地址:http://www.etongwl.com/?p=411
我的CSDN地址:http://blog.csdn.net/zdl_411437734/article/details/41280969