Hello,
When running PHP Unit (https://docs.moodle.org/dev/PHPUnit) on Moodle 3.9 on Ubuntu 20.04 with Apache in the www-data user and group and following https://docs.moodle.org/39/en/Installing_Moodle_on_Debian_based_distributions then Composer complains that:
it should not be run as 'root' and yet unless I do 'sudo' then the php process won't work. Also https://docs.moodle.org/39/en/Installing_Moodle_on_Debian_based_distributions seems to contradict https://docs.moodle.org/39/en/Installing_Moodle#Download_and_copy_files_into_place, where the first makes the Moodle code files writable by the web server user 'www-data' and the second by 'root' and says that the files should not be writable by the web server!
So how do you run composer / PHP Unit not as 'root' and get things to work please?
Gareth