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

9,053

The www-data is for ubuntu, try with apache for username and group

sudo chown -R apache:apache /var/www/laravel/ 

Make sure that the package is install.

Share:
9,053
Cebrayil
Author by

Cebrayil

Updated on September 18, 2022

Comments

  • Cebrayil
    Cebrayil over 1 year

    I am trying to install laravel , now I need to Set the required permissions for the project . when I wrote sudo chown -R www-data:www-data /var/www/laravel/ I am getting error chown: invalid user: ‘www-data:www-data’ .What is the problem?

    • Seth
      Seth almost 5 years
      It clearly states what the problem is so what are you confused about?
    • Cebrayil
      Cebrayil almost 5 years
      I am using nginx not apache .can I write sudo chown -R nginx:nginx /var/www/laravel is the same thing?
    • Seth
      Seth almost 5 years
      You will have to check how your system is setup and what users actually exist. For example do a ls -la /var and look what user and group is set for the www directory, check your service configuration, htop or your passwd file.
    • Cebrayil
      Cebrayil almost 5 years
      I checked etc/passwd nginx:x:998:996:nginx user:/var/cache/nginx: this line exist .
    • Seth
      Seth almost 5 years
      In that case you could try our suggestion. The target of the chown command is to make the file owned by the user and group the webserver uses.
  • Cebrayil
    Cebrayil almost 5 years
    sudo chown -R nginx:nginx /var/www/laravel/ is that okey?
  • pioupiou
    pioupiou almost 5 years
    Yes run with that, i don't know you have nginx