Proper use of Composer

NTT

Verified User
Joined
Nov 28, 2020
Messages
20
A client asked me to install SuiteCRM for him, and once installed SuiteCRM requires PHPMailer to be installed in order for e-mail to work.

That looks to be as simple as building composer (done), and running:

Code:
composer require phpmailer/phpmailer

When I do that as root composer throws a warning that I shouldn't do so, which I'm willing to heed. When I run as the user with sudo I get:

1648246782949.png


I'm new to composer and I'm missing something basic here. Searches on this suggest completely deleting the public_html folder as part of the installation and that seems like a silly level of effort top install a PHP component. I'm missing something basic.

How should I be approaching the installation of PHPMailer?

Thanks. Hope this is in the right place.
 
Installing composer is here
To install composer:

Code:
/usr/local/directadmin/custombuild/build composer


You should most likely ask on their forum. However looks like you just need to configure the SMTP settings.

Looks like it already installed
 
First: never run Composer update/require as root: https://getcomposer.org/doc/faqs/how-to-install-untrusted-packages-safely.md

Run Composer from the user account, not root. Running it as root can also mess up your permissions.

Do you have a composer.json/.lock file in the root directory of your website? It seems based on the error that you don't have one. I don't know SuiteCRM and if it uses Composer. If SuiteCRM doesn't use Composer it makes no sense to install PHPMailer with composer
 
Last edited:
First: never run Composer update/require as root: https://getcomposer.org/doc/faqs/how-to-install-untrusted-packages-safely.md

Run Composer from the user account, not root. Running it as root can also mess up your permissions.

Do you have a composer.json/.lock file in the root directory of your website? It seems based on the error that you don't have one. I don't know SuiteCRM and if it uses Composer. If SuiteCRM doesn't use Composer it makes no sense to install PHPMailer with composer
how can i fix it

composer -V
Do not run Composer as root/super user! See https://getcomposer.org/root for details
Continue as root/super user [yes]?
Composer version 2.6.6 2023-12-08 18:32:26
 
Back
Top