1

PHP Composer does not want to be run as root. PHP-FPM runs as www-data.

When I create a new laravel app using composer, do I want to create a new user for the app, and then chown the public directory as www-data? Or do I want to sudo as www-data to create the app using composer?

Is sudo running as root, or a super admin? If I create a directory with sudo, it is owned by root. Assuming the OS I use runs super admin tasks as root..? I have much to learn, please offer guidance.

Mehravish Temkar
  • 4,275
  • 3
  • 25
  • 44
The Dude man
  • 383
  • 6
  • 19
  • 1
    Here's a great answer: https://stackoverflow.com/questions/30639174/file-permissions-for-laravel-5-and-others#37266353 – The Dude man May 02 '18 at 14:17

1 Answers1

1

Assuming you are in Linux, after you create the project as root, you can chown your project folder to www-data:www-data and don't forget to also chmod them.

Muabazalm
  • 364
  • 2
  • 12