版权声明:转载请注明出处 https://blog.csdn.net/geol200709/article/details/82979315
WordPress 安装插件或升级,都会提示创建目录失败
进入 WordPress 工作目录下,使用 ls -l
命令,查看 WordPress 工作目录下的文件详情,可以看到所在工作组。
[root@host wordpress]# ls -l
total 196
-rw-r--r-- 1 root root 418 Oct 9 10:35 index.php
-rwxrwxrwx 1 root root 19935 Oct 9 10:46 license.txt
-rwxrwxrwx 1 root root 7415 Oct 9 10:46 readme.html
-rwxr-xr-x 1 root root 5458 Oct 9 10:35 wp-activate.php
drwxr-xr-t 9 root root 4096 Oct 8 19:43 wp-admin
-rw-r--r-- 1 root root 364 Oct 9 10:35 wp-blog-header.php
-rw-r--r-- 1 root root 1889 Oct 9 10:35 wp-comments-post.php
-rw-r--r-- 1 root root 3294 Oct 8 19:43 wp-config.php
-rwxr-xr-x 1 root root 2853 Oct 9 10:35 wp-config-sample.php
drwxr-xr-t 6 root root 4096 Oct 8 19:43 wp-content
-rw-r--r-- 1 root root 3669 Oct 9 10:35 wp-cron.php
drwxr-xr-t 18 root root 12288 Oct 8 19:43 wp-includes
-rw-r--r-- 1 root root 2422 Oct 9 10:35 wp-links-opml.php
-rw-r--r-- 1 root root 3306 Oct 9 10:35 wp-load.php
-rwxr-xr-x 1 root root 37794 Oct 9 10:35 wp-login.php
-rw-r--r-- 1 root root 8048 Oct 9 10:35 wp-mail.php
-rw-r--r-- 1 root root 16246 Oct 9 10:35 wp-settings.php
-rw-r--r-- 1 root root 30091 Oct 9 10:35 wp-signup.php
-rw-r--r-- 1 root root 4620 Oct 9 10:35 wp-trackback.php
-rw-r--r-- 1 root root 3065 Oct 9 10:35 xmlrpc.php
以上可以看到,他们处于root工作组下,而我们更新下载操作,需要在Web组,即用户组www。
下面将其修改
[root@host wordpress]# chown -R www:www ./
然后再次查看用户组
[root@host wordpress]# ls -l
total 196
-rw-r--r-- 1 www www 418 Oct 9 10:35 index.php
-rwxrwxrwx 1 www www 19935 Oct 9 10:46 license.txt
-rwxrwxrwx 1 www www 7415 Oct 9 10:46 readme.html
-rwxr-xr-x 1 www www 5458 Oct 9 10:35 wp-activate.php
drwxr-xr-t 9 www www 4096 Oct 8 19:43 wp-admin
-rw-r--r-- 1 www www 364 Oct 9 10:35 wp-blog-header.php
-rw-r--r-- 1 www www 1889 Oct 9 10:35 wp-comments-post.php
-rw-r--r-- 1 www www 3294 Oct 8 19:43 wp-config.php
-rwxr-xr-x 1 www www 2853 Oct 9 10:35 wp-config-sample.php
drwxr-xr-t 6 www www 4096 Oct 8 19:43 wp-content
-rw-r--r-- 1 www www 3669 Oct 9 10:35 wp-cron.php
drwxr-xr-t 18 www www 12288 Oct 8 19:43 wp-includes
-rw-r--r-- 1 www www 2422 Oct 9 10:35 wp-links-opml.php
-rw-r--r-- 1 www www 3306 Oct 9 10:35 wp-load.php
-rwxr-xr-x 1 www www 37794 Oct 9 10:35 wp-login.php
-rw-r--r-- 1 www www 8048 Oct 9 10:35 wp-mail.php
-rw-r--r-- 1 www www 16246 Oct 9 10:35 wp-settings.php
-rw-r--r-- 1 www www 30091 Oct 9 10:35 wp-signup.php
-rw-r--r-- 1 www www 4620 Oct 9 10:35 wp-trackback.php
-rw-r--r-- 1 www www 3065 Oct 9 10:35 xmlrpc.php
这时更新 WordPress,则成功