Minor Fixes

This commit is contained in:
earnolmartin 2020-03-25 22:34:33 -06:00
parent 48d45765e2
commit 6ecdd7c083
2 changed files with 17 additions and 10 deletions

View file

@ -1396,12 +1396,16 @@ function CheckPreReqs(){
function installPHPFPM(){
aptgetInstall php5-fpm
aptgetInstall php-fpm
phpfpmversionsFromCache=$(apt-cache search "fpm" | grep "php" | grep "\-fpm" | head -n 2 | awk '{print $1}')
for version in "$phpfpmversionsFromCache" ; do
if [ ! -z "$version" ]; then
aptgetInstall "$version"
fi
done
countOfPHPFPM=$(apt-cache search "fpm" | grep "php" | grep "\-fpm" | awk '{print $1}' | wc -l)
if [ "$countOfPHPFPM" -le "2" ]; then
phpfpmversionsFromCache=$(apt-cache search "fpm" | grep "php" | grep "\-fpm" | head -n 2 | awk '{print $1}')
for version in "$phpfpmversionsFromCache" ; do
if [ ! -z "$version" ]; then
aptgetInstall "$version"
fi
done
fi
}
function addConfDFolder(){

View file

@ -1251,10 +1251,13 @@ function install_nginx_webserver(){
aptget(array('nginx','php5-fpm','php-fpm','php5-cgi','php-cgi')); # apt-get install nginx php5-fpm php5-cgi
// Detect php-fpm specific verison in case above fails
$phpFPMVersions = shell_exec("apt-cache search 'fpm' | grep 'php' | grep '\-fpm' | head -n 2 | awk '{print \$1}'");
$arrayOfPHPFPM = array_filter(explode(PHP_EOL, $phpFPMVersions));
if(isset($arrayOfPHPFPM) && is_array($arrayOfPHPFPM) && count($arrayOfPHPFPM)){
aptget($arrayOfPHPFPM);
$numPHPFPMVersions = trim(shell_exec("apt-cache search 'fpm' | grep 'php' | grep '\-fpm' | awk '{print \$1}' | wc -l"));
if(!empty($numPHPFPMVersions) && is_numeric($numPHPFPMVersions) && intval($numPHPFPMVersions) <= 2){
$phpFPMVersions = shell_exec("apt-cache search 'fpm' | grep 'php' | grep '\-fpm' | head -n 2 | awk '{print \$1}'");
$arrayOfPHPFPM = array_filter(explode(PHP_EOL, $phpFPMVersions));
if(isset($arrayOfPHPFPM) && is_array($arrayOfPHPFPM) && count($arrayOfPHPFPM)){
aptget($arrayOfPHPFPM);
}
}
copy("$mydir/etc/nginx/mime.types","/etc/nginx/mime.types");