DEV Community

Nazareno Pesado
Nazareno Pesado

Posted on

Install ext-sodium on AWS Lightsail Bitnami LAMP Instance

One of my agency projects on Laravel has a composer dependency that needs "sodium PHP extension", but Bitnami LAMP instance doesn't come with it installed.

So after trying for almost one hour i successfully install it following this steps:

  1. First you need to install libsodium-dev through apt
sudo apt install libsodium-dev
Enter fullscreen mode Exit fullscreen mode
  1. Then, using PECL (PHP Extension Manager) you have to install the extension per se
sudo pecl install -f libsodium
Enter fullscreen mode Exit fullscreen mode
  1. Finally, edit php.ini file to activate the extension and restart the services
sudo nano /opt/bitnami/php/etc/php.ini
# find "extension=sodium" and uncomment it

sudo /opt/bitnami/ctlscript.sh restart
Enter fullscreen mode Exit fullscreen mode

With these steps you have installed PHP sodium extension in your instance

Top comments (0)