设置WP时,您(Web服务器)可能需要对文件进行写访问.因此,访问权限可能需要放宽.
chown www-data:www-data -R * # Let Apache be owner
find . -type d -exec chmod 755 {} \; # Change directory permissions rwxr-xr-x
find . -type f -exec chmod 644 {} \; # Change file permissions rw-r--r--
After the setup you should tighten the access rights,根据Hardening WordPress,除wp内容之外的所有文件都应该只能由您的用户帐户写入.wp内容也必须可由www-data写入.
chown <username>:<username> -R * # Let your useraccount be owner
chown www-data:www-data wp-content # Let apache be owner of wp-content
也许你以后想更改wp内容中的内容.在这种情况下,你可以
su
,无论您做什么,都要确保文件具有www-data的读写权限.