Skip to end of metadata
Go to start of metadata

You are viewing an old version of this content. View the current version.

Compare with Current View Version History

« Previous Version 2 Next »

This guide is a step-by-step procedure on how to install php libsodium package In AWS instances. Libsodium package is required for the moodle version 4 and above. Before continuing with the implementation is always a good practise to take AMIs of our instances so we can always revert if something goes wrong.

Install perl (pecl)

In case we have this already installed continue with Install libsodium

Check if perl is installed

We can check if it exists in path /usr/bin/ or by typing command

$ which perl

Install commands

In order to install perl we need to fetch it in /home/ec2-user

cd /home/ec2-user
wget http://pear.php.net/go-pear.phar
sudo php go-pear.phar

Install libsodium

In order to install libsodium we need to first compile it. It will not work if we use directly the pecl commands.

Download libsodium source, extract and compile

notice that after we extract we switch into superuser, sudo it self didn’t work.

wget https://download.libsodium.org/libsodium/releases/LATEST.tar.gz
tar -xzf LATEST.tar.gz
cd libsodium-stable/
sudo su
./configure
make && make check
make install

Install libsodium via pecl

sudo pecl install -f libsodium

check in folder that it exists

cd /usr/local/lib

we need to navigate into /etc/php-7.3.d/ in order to make an extenstion for php to use

cd /etc/php-7.3.d/
sudo vim 50-libsodium.ini

Inside libsodium.ini we write

extension=sodium.so

Right after we restart php-fpm

sudo service php-fpm restart

Check that is installed correctly by phpinfo or with the command

php -i | grep "sodium"

  • No labels