FIXED clear cache failing with opcache.
Php 7.4 is now obsolete.
This commit is contained in:
Cristhian Martínez Ochoa 2022-12-18 12:04:16 -07:00
parent b3592fb9bf
commit b1f0594c0f
4 changed files with 12 additions and 12 deletions

View file

@ -4,7 +4,7 @@
# Prevent 'tput' errors when running from Cron
[[ -z $TERM || $TERM == "unknown" || $TERM == "dumb" ]] && export TERM=dumb
readonly app_version="1.17.0"
readonly app_version="1.17.1"
readonly svr_version="1.8"
readonly os_ubuntu_supported=(bionic focal jammy) # https://ubuntu.com/about/release-cycle
readonly php_supported=(7.4 8.0 8.1 8.2) # https://www.php.net/supported-versions.php

View file

@ -577,11 +577,11 @@ if [[ -z $critical_mode ]]; then
if ! [[ $ver_php_ver =~ ^(5.6|7.0|7.1|7.2|7.3|7.4|8.0|8.1|8.2)$ ]]; then
echo "${dim}- [WARNING] Unknown PHP version!${end}${red}"
local ver_three_war="1"
elif [[ $ver_php_ver =~ ^(5.6|7.0|7.1|7.2|7.3)$ ]]; then
elif [[ $ver_php_ver =~ ^(5.6|7.0|7.1|7.2|7.3|7.4)$ ]]; then
echo "${dim}- [WARNING] You have an obsolete PHP version (${ver_php_ver}) installed that not even receive security updates!${end}${red}"
local ver_three_war="1"
elif [[ $ver_php_ver == "7.4" ]]; then
echo "${blu}${dim}- [INFO] PHP v8.0 or later is recommended to get an optimal perfomance! (Current: ${ver_php_ver}) ${end}${red}"
#elif [[ $ver_php_ver == "8.0" ]]; then
# echo "${blu}${dim}- [INFO] PHP v8.1 or later is recommended to get an optimal perfomance! (Current: ${ver_php_ver}) ${end}${red}"
fi
fi

View file

@ -829,15 +829,14 @@ clear_caches() {
fi
if [[ $clear_cache =~ ^(opcache|all)$ ]]; then
if [[ $(conf_read nginx) == "true" && $(conf_read php) == "true" ]]; then
port=$(conf_read tools-port)
if [[ ! -f /var/www/$port/htdocs/php/opcache/index.php ]]; then
sudo mkdir /var/www/$port/htdocs/php/opcache
sudo touch /var/www/$port/htdocs/php/opcache/index.php
echo '<?php opcache_reset(); echo "OK\n";' > /var/www/$port/htdocs/php/opcache/index.php
sudo chown -R www-data:www-data /var/www/$port/htdocs/php/opcache
sudo chmod 644 /var/www/$port/htdocs/php/opcache/index.php
if [[ ! -f /var/www/$ADMIN_TOOLS_SITE/htdocs/php/opcache/index.php ]]; then
sudo mkdir /var/www/$ADMIN_TOOLS_SITE/htdocs/php/opcache
sudo touch /var/www/$ADMIN_TOOLS_SITE/htdocs/php/opcache/index.php
echo '<?php opcache_reset(); echo "OK\n";' > /var/www/$ADMIN_TOOLS_SITE/htdocs/php/opcache/index.php
sudo chown -R www-data:www-data /var/www/$ADMIN_TOOLS_SITE/htdocs/php/opcache
sudo chmod 644 /var/www/$ADMIN_TOOLS_SITE/htdocs/php/opcache/index.php
fi
wget --spider --no-check-certificate --timeout=15 -t 1 localhost:$port/php/opcache/ > /dev/null 2>&1 &
wget --spider --no-check-certificate --timeout=15 -t 1 localhost:$(conf_read tools-port)/php/opcache/ > /dev/null 2>&1 &
echo "${gre}- OpCache has been successfully cleared!${end}"
else
echo "${red}[ERROR] We can not clear OpCache because PHP or NGINX are not installed!${end}"

View file

@ -108,6 +108,7 @@
# Nginx Access Logs Disabled
# Values: boolean (true/false)
# Default: true
# Note: This setting will be applied to new sites, or for existing sites 'access log' needs to be reenabled (same for global).
# Same as: sudo log -only-error=on
###########################
#global-access-log-off:true