check if redis.so is enabled (#787)

This commit is contained in:
Daniel Hansson 2019-02-19 21:24:46 +01:00 committed by GitHub
parent 3bd2892dae
commit 512ecaa6ce
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -78,6 +78,20 @@ then
pecl channel-update pecl.php.net
yes no | pecl install redis
service redis-server restart
# Check if redis.so is enabled
# PHP 7.0 apache
if [ -f /etc/php/7.0/apache2/php.ini ]
then
! [[ "$(grep -R extension=redis.so /etc/php/7.0/apache2/php.ini)" == "extension=redis.so" ]] > /dev/null 2>&1 && echo "extension=redis.so" >> /etc/php/7.0/apache2/php.ini
# PHP 7.2 apache
elif [ -f /etc/php/7.2/apache2/php.ini ]
then
! [[ "$(grep -R extension=redis.so /etc/php/7.2/apache2/php.ini)" == "extension=redis.so" ]] > /dev/null 2>&1 && echo "extension=redis.so" >> /etc/php/7.2/apache2/php.ini
# PHP 7.2 fpm
elif [ -f "$PHP_INI" ]
then
! [[ "$(grep -R extension=redis.so "$PHP_INI")" == "extension=redis.so" ]] > /dev/null 2>&1 && echo "extension=redis.so" >> "$PHP_INI"
fi
restart_webserver
elif pecl list | grep redis >/dev/null 2>&1
then
@ -90,6 +104,20 @@ then
pecl channel-update pecl.php.net
yes no | pecl upgrade redis
service redis-server restart
# Check if redis.so is enabled
# PHP 7.0 apache
if [ -f /etc/php/7.0/apache2/php.ini ]
then
! [[ "$(grep -R extension=redis.so /etc/php/7.0/apache2/php.ini)" == "extension=redis.so" ]] > /dev/null 2>&1 && echo "extension=redis.so" >> /etc/php/7.0/apache2/php.ini
# PHP 7.2 apache
elif [ -f /etc/php/7.2/apache2/php.ini ]
then
! [[ "$(grep -R extension=redis.so /etc/php/7.2/apache2/php.ini)" == "extension=redis.so" ]] > /dev/null 2>&1 && echo "extension=redis.so" >> /etc/php/7.2/apache2/php.ini
# PHP 7.2 fpm
elif [ -f "$PHP_INI" ]
then
! [[ "$(grep -R extension=redis.so "$PHP_INI")" == "extension=redis.so" ]] > /dev/null 2>&1 && echo "extension=redis.so" >> "$PHP_INI"
fi
restart_webserver
fi