0

I'm not great with server admin stuff but have to sometimes handle installs. The situation is the global composer is not using the correct version of PHP so I put locally to their /var/www/html a composer.phar so I can manually use the PHP version I want like: /custom/php/version/php composer.phar

They give me a SSH user in Ubuntu that has SUDO permissions. If I don't run the composer commands with SUDO it gives permissions errors. But I'm not supposed to use SUDO / root with composer so how should I handle this? Do I need to add my SSH user to the same group as www-data, or what is the correct way? Another way I thought would be to SU to the www-data user but not sure what way is correct.

Kevin Chavez
  • 445
  • 1
  • 4
  • 16
  • 1
    Does this answer your question? [Tell Composer to use Different PHP Version](https://stackoverflow.com/questions/32750250/tell-composer-to-use-different-php-version) – Nico Haase Feb 10 '21 at 09:34
  • Additionally, please never, never, never use `sudo` to solve a problem that is not related to permissions. That will only lead to other problems – Nico Haase Feb 10 '21 at 09:35
  • thanks @NicoHaase but no it doesn't. I know how to make composer use a different version of php. But when I run SSH commands the files made / created by composer are then under my SSH username, not www-data. What is the best way to fix this? – Kevin Chavez Feb 12 '21 at 04:35
  • 1
    That's not what I've understood from the initial question - you could either put your user in the `www-data` group, or simply use `www-data` for deployments – Nico Haase Feb 12 '21 at 05:32
  • ok thanks I'll accept that as the answer if you make it one – Kevin Chavez Feb 12 '21 at 13:36

0 Answers0