在本机调试wordpress时,在线升级wordpress,安装主题和插件都出现提示要输入FTP的用户名和密码。apache默认是以daemon用户组启动的。不像lnmp一键包那样,已经提前设置好了nginx的用户组。
解决办法如下:
找到apache的配置文件httpd.conf,找到:
#
# 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 daemon
Group daemon
也有人说他们的用户默认是
User nobody
Group admin
反正不是系统用户
这时把这两行改为
User 系统用户名 Group staff
然后重启一下apache服务
sudo apachectl restart
然后一切就都顺利了。