Skip to content

Commit 0e798c0

Browse files
authored
redis fixes (#65)
1 parent 40a72ac commit 0e798c0

File tree

2 files changed

+8
-7
lines changed

2 files changed

+8
-7
lines changed

static/redis-server-ubuntu.sh

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -48,12 +48,11 @@ else
4848
fi
4949
install_if_not redis-server
5050

51-
# Set globally doesn't work for some reason
52-
# touch /etc/php/7.0/mods-available/redis.ini
53-
# print_text_in_color "$ICyan" 'extension=redis.so' > /etc/php/7.0/mods-available/redis.ini
54-
# phpenmod redis
55-
# Setting direct to apache2 works if 'libapache2-mod-php7.0' is installed
51+
# FPM is needed for frontend
5652
echo 'extension=redis.so' >> /etc/php/"$PHPVER"/fpm/php.ini
53+
# CLI is needed for backend
54+
echo 'extension=redis.so' >> /etc/php/"$PHPVER"/cli/php.ini
55+
service php"$PHPVER"-fpm restart
5756
service nginx restart
5857

5958
# Install Redis

wordpress_install.sh

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -204,7 +204,7 @@ sed -i "s|post_max_size =.*|post_max_size = 110M|g" /etc/php/"$PHPVER"/fpm/php.i
204204
sed -i "s|cgi.fix_pathinfo =.*|cgi.fix_pathinfo=0|g" /etc/php/"$PHPVER"/fpm/php.ini
205205
sed -i "s|date.timezone =.*|date.timezone = Europe/Stockholm|g" /etc/php/"$PHPVER"/fpm/php.ini
206206

207-
# Make sure the passwords are the same, this file will be deleted when Redis is run.
207+
# Make sure the passwords are the same, this file will be deleted when redis is run.
208208
check_command echo "$REDIS_PASS" > $REDISPTXT
209209

210210
# Install Redis
@@ -311,8 +311,10 @@ define( 'WP_REDIS_CLIENT', 'pecl' );
311311
define( 'WP_REDIS_SCHEME', 'unix' );
312312
/** REDIS PATH TO SOCKET */
313313
define( 'WP_REDIS_PATH', '$REDIS_SOCK' );
314-
/** REDIS SALT */
314+
/** REDIS TTL */
315315
define('WP_REDIS_MAXTTL', 9600);
316+
/** REDIS SALT */
317+
define('WP_REDIS_PREFIX', change_this_redis_salt_to_your_domain_name);
316318
317319
/** AUTO UPDATE */
318320
define( 'WP_AUTO_UPDATE_CORE', true );

0 commit comments

Comments
 (0)