diff --git a/scripts/install_php.sh b/scripts/install_php.sh index e62eb80e..9941d33d 100755 --- a/scripts/install_php.sh +++ b/scripts/install_php.sh @@ -2,7 +2,7 @@ # PHP Installer # Min. Requirement : GNU/Linux Ubuntu 18.04 -# Last Build : 11/12/2021 +# Last Build : 09/01/2022 # Author : MasEDI.Net (me@masedi.net) # Since Version : 1.0.0 @@ -195,6 +195,14 @@ function install_php() { run mkdir -p /var/log/php fi + if [[ ! -d "/home/${LEMPER_USERNAME}/logs/php" ]]; then + run mkdir -p "/home/${LEMPER_USERNAME}/logs/php" + fi + + # Log rotation. + run cp -f "etc/logrotate.d/php${PHPv}-fpm" /etc/logrotate.d/ && \ + run chmod 0644 "/etc/logrotate.d/php${PHPv}-fpm" + # Optimize PHP & FPM configuration. optimize_php_fpm "${PHPv}" fi @@ -253,6 +261,12 @@ function optimize_php_fpm() { run cp -f "etc/php/${PHPv}/fpm/php.ini" "/etc/php/${PHPv}/fpm/" else if [[ "${DRYRUN}" != true ]]; then + if [[ "${ENVIRONMENT}" =~ "prod" ]]; then + OVT="${OVT:-"0"}" + else + OVT="${OVT:-"1"}" + fi + cat >> "/etc/php/${PHPv}/fpm/php.ini" <