您的Web服务器在OS X 10.6上的用户帐户下运行,该用户是_www 而且这个团队_www
WordPress需要web服务器的所有者和/或组来匹配文件的所有者和/或组,即您的用户帐户。
首先,打开终端。通过键入以下内容查找您的用户名和组:id
您应该看到如下输出:
uid=503(gabrielk) gid=20(staff) 团队=20人(员工),[一群其他人]
请注意括号中的前两个值。这是您的用户和组。
接下来编辑Apache配置并将其设置为以用户身份运行&;组在终端类型中:sudo nano /Applications/XAMPP/etc/httpd.conf
(在未运行XAMPP的默认OS X安装中,您可以键入:sudo nano /etc/apache2/httpd.conf
)
查找此部分(这是OS X中的默认httpd.conf,XAMPP中的可能略有不同,但配置值将相同):
#
# 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 _www
Group _www
更改用户和组以匹配您的用户和组。就我而言:
#
# 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 gabrielk
Group staff
保存,然后重新启动Apache。在默认的OS X安装中,将是:
sudo apachectl restart
在那之后WordPress应该不会给你带来任何麻烦。但是,请注意,下次更新OS X时可能需要重复这些步骤。