Important: See the documentation link below about Plesk Obsidian using a composer extension. If you are using Plesk Obsidian this is the recommended way to run composer on a plesk server.
From the Plesk documentation:
Run Composer from a command-line interface
Where X.X is a PHP version:
on CentOS/RHEL-based distributions:
# /opt/plesk/php/X.X/bin/php /usr/lib64/plesk-9.0/composer.phar [options] [arguments]
on Debian/Ubuntu-based distributions:
# /opt/plesk/php/X.X/bin/php /usr/lib/plesk-9.0/composer.phar [options] [arguments]
on Windows Server:
C:> "%plesk_dir%AdditionalPleskPHPXXphp.exe" "%plesk_dir%AdditionalComposercomposer.phar" [options] [arguments]
Documentation links:
https://www.plesk.com/kb/support/how-to-run-composer-with-plesk-php/