参考网上经验,写了个WP文件权限设置脚本。方便部署迁移只用。
06 | if [ ! -d "${1}" ]; then |
11 | if [ ! -d "./wp-content/" ]; then |
12 | echo wordpress not found. |
18 | find ./ - type d - exec chmod 755 {} \; |
19 | find ./ -iname "*.php" - exec chmod 644 {} \; |
20 | chmod 775 ./wp-content/ |
21 | chmod 775 ./wp-content/plugins/ |
22 | chmod 775 ./wp-content/themes/ |
23 | find ./wp-content/themes/ -iname "*.php" - exec chmod 664 {} \; |
24 | find ./wp-content/themes/ -iname "*.css" - exec chmod 664 {} \; |
25 | chmod 644 ./wp-content/themes/index.php |
26 | if [ -d "./wp-content/uploads" ]; then |
27 | chmod 664 ./wp-content/uploads/ -R |
28 | chmod 775 ./wp-content/uploads/ |
29 | find ./wp-content/uploads/ - type d - exec chmod 775 {} \; |
31 | if [ -d "./wp-content/upgrade" ]; then |
32 | chmod 775 ./wp-content/upgrade/ |