diff --git a/mod_php_install.sh b/mod_php_install.sh index d4a73cc..1515c08 100755 --- a/mod_php_install.sh +++ b/mod_php_install.sh @@ -2801,11 +2801,11 @@ if [[ -n "$zend_extension_opcache" ]];then echo_failed fi - ## - set opcache.enable_cli=0 + ## - set opcache.enable_cli=1 ## - - echononl "\tphp.ini: opcache.enable_cli = 0 .." + echononl "\tphp.ini: opcache.enable_cli = 1 .." opcache_key="opcache.enable_cli" - opcache_val=0 + opcache_val=1 if grep -e "^\s*${opcache_key}\s*=" $PHP_INI_FILE > /dev/null 2>&1 ; then perl -i -n -p -e "s#^(\s*${opcache_key}\s*=.*)#;\1\n*${opcache_key} = ${opcache_val}#" $PHP_INI_FILE _retval=$? @@ -2839,9 +2839,9 @@ if [[ -n "$zend_extension_opcache" ]];then ## - set opcache.max_accelerated_files=4000 ## - - echononl "\tphp.ini: opcache.max_accelerated_files = 4000 .." + echononl "\tphp.ini: opcache.max_accelerated_files = 10000 .." opcache_key="opcache.max_accelerated_files" - opcache_val=4000 + opcache_val=10000 if grep -e "^\s*${opcache_key}\s*=" $PHP_INI_FILE > /dev/null 2>&1 ; then perl -i -n -p -e "s#^(\s*${opcache_key}\s*=.*)#;\1\n*${opcache_key} = ${opcache_val}#" $PHP_INI_FILE _retval=$? @@ -2873,11 +2873,47 @@ if [[ -n "$zend_extension_opcache" ]];then echo_failed fi - ## - set opcache.revalidate_freq=60 + ## - set opcache.memory_consumption=128 ## - - echononl "\tphp.ini: opcache.revalidate_freq = 60 .." + echononl "\tphp.ini: opcache.memory_consumption = 1 .." + opcache_key="opcache.memory_consumption" + opcache_val=128 + if grep -e "^\s*${opcache_key}\s*=" $PHP_INI_FILE > /dev/null 2>&1 ; then + perl -i -n -p -e "s#^(\s*${opcache_key}\s*=.*)#;\1\n*${opcache_key} = ${opcache_val}#" $PHP_INI_FILE + _retval=$? + elif grep -e "^\s*;\s*${opcache_key}\s*=" $PHP_INI_FILE > /dev/null 2>&1 ; then + perl -i -n -p -e "s#^(\s*;${opcache_key}\s*=.*)#\1\n${opcache_key} = ${opcache_val}#" $PHP_INI_FILE + _retval=$? + fi + if [ "$_retval" = "0" ]; then + echo_ok + else + echo_failed + fi + + ## - set opcache.save_comments=1 + ## - + echononl "\tphp.ini: opcache.save_comments = 1 .." + opcache_key="opcache.save_comments" + opcache_val=1 + if grep -e "^\s*${opcache_key}\s*=" $PHP_INI_FILE > /dev/null 2>&1 ; then + perl -i -n -p -e "s#^(\s*${opcache_key}\s*=.*)#;\1\n*${opcache_key} = ${opcache_val}#" $PHP_INI_FILE + _retval=$? + elif grep -e "^\s*;\s*${opcache_key}\s*=" $PHP_INI_FILE > /dev/null 2>&1 ; then + perl -i -n -p -e "s#^(\s*;${opcache_key}\s*=.*)#\1\n${opcache_key} = ${opcache_val}#" $PHP_INI_FILE + _retval=$? + fi + if [ "$_retval" = "0" ]; then + echo_ok + else + echo_failed + fi + + ## - set opcache.revalidate_freq=1 + ## - + echononl "\tphp.ini: opcache.revalidate_freq = 1 .." opcache_key="opcache.revalidate_freq" - opcache_val=60 + opcache_val=1 if grep -e "^\s*${opcache_key}\s*=" $PHP_INI_FILE > /dev/null 2>&1 ; then perl -i -n -p -e "s#^(\s*${opcache_key}\s*=.*)#;\1\n*${opcache_key} = ${opcache_val}#" $PHP_INI_FILE _retval=$?