Facing issue with Install Composer and Twilio SDK in server

I’m using Hestia server and have multiple websites hosted on it. I need to install Composer and the PHP Twilio SDK for WhatsApp API integration on my site (URL: https://your-guardian.com/).

My server is running PHP version 8.2.23. When I try to install Composer using the PHP command (php composer-setup.php), it doesn’t work, and I suspect there might be restrictions or missing configurations on the server.

Can someone guide me on:

  1. Installing Composer globally on the Hestia server?
  2. Setting up the PHP Twilio SDK via Composer for my website?

I have SSH access and can follow any provided instructions.

Thanks in advance!

v-add-user-composer user

Will install it for the user only
~/.composer/composer require twilio/sdk

Will install the package you want

If you want to install composer globally

php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');"
php -r "if (hash_file('sha384', 'composer-setup.php') === 'dac665fdc30fdd8ec78b38b9800061b4150413ff2e3b6f88543c636f7cd84f6db9189d43a81e5503cda447da73c7e5b6') { echo 'Installer verified'; } else { echo 'Installer corrupt'; unlink('composer-setup.php'); } echo PHP_EOL;"
php composer-setup.php
php -r "unlink('composer-setup.php');"
sudo mv composer.phar /usr/local/bin/composer
2 Likes

Thanks for your support!!!