0

I'm trying to install wordpress, and i'm following an article on the web, and one of the steps is:

Now, we need to change the permission of the ‘wordpress‘ directory. Prompt to the wordpress directory in the root directory we just copied and run the following command:

sudo chown -R username:www-data *

This command will assign the control of our wordpress directory to www-data user. This is a user web servers used to access the files. In this way the server would be able to write directly to our wordpress directory.

So I change directories, and go into the wordpress dir that's in root, run the command but get this error code:

chown: invalid user: ‘username:www-data’

I'm not sure if I'm supposed to put something other than username (the article it does specify this) or do something else.

muru
  • 197,895
  • 55
  • 485
  • 740
LuanL
  • 3

1 Answers1

0

In the command, you are supposed to replace username with your actual username. You can find out what that is by opening a terminal and entering whoami.

You could also replace it with root if you wanted, although in this case you should add your user to the www-data group with sudo usermod -a -G www-data username.

See also:

TheSchwa
  • 3,820
  • Thank you, i tried replacing it with my username, but it did not work. But it worked with root. I think it does not work with my username since there is some kind of problem with it even when i run other commands theres always this "warning" i guess which says "sudo: unable to resolve host username" . – LuanL Mar 06 '16 at 23:26
  • @LuanL In the terminal enter whoami and see if the result is the same as what you think your username is. – TheSchwa Mar 06 '16 at 23:29
  • It is not actually. Never even checked. – LuanL Mar 06 '16 at 23:30