Last active
August 16, 2019 10:16
-
-
Save kevinski303/55f38a77f6c950a19095c9b0c8dde8ed to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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