Skip to content

Instantly share code, notes, and snippets.

@kevinski303
Last active August 16, 2019 10:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kevinski303/55f38a77f6c950a19095c9b0c8dde8ed to your computer and use it in GitHub Desktop.
Save kevinski303/55f38a77f6c950a19095c9b0c8dde8ed to your computer and use it in GitHub Desktop.
#!/bin/bash -e
echo extracting the mcrypt archive
if ls | grep mcrypt-1.0.2.tgz &> /dev/null; then
tar -zxvf ./mcrypt-*.tgz &> /dev/null && cd mcrypt-*/
else
echo archive is missing
fi
if command -v phpize; then
echo compiling mcrypt module with phpize
phpize &> /dev/null
./configure &> /dev/null
else
echo the phpize command is not available
fi
if command -v make; then
echo installing the module to lib
make install &> /dev/null
else
echo the make command is not available
fi
echo checking if the mcrypt module is available...
if ls /usr/lib/php/20180731/ | grep mcrypt.so &> /dev/null; then
echo module is available
else
echo couldnt find the module in the /usr/lib path
fi
echo enabling module in php ini and restarting apache
if cat /etc/php/7.3/apache2/php.ini | grep extension=mcrypt.so &> /dev/null; then
echo module already enabled
else
echo 'extension=mcrypt.so' >> /etc/php/7.3/apache2/php.ini
echo module enabled
fi
echo restarting apache webserver
systemctl restart apache2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment