Skip to content

Conversation

@neil-greenwood
Copy link
Contributor

Option ID has changed? Use option_name instead, so ALB update is not broken in /home/ec2-user/update_wp_ip.sh

Option ID has changed? Use option_name instead, so ALB update is not broken in /home/ec2-user/update_wp_ip.sh
source <(php -r 'require("/var/www/html/wp-config.php"); echo("DB_NAME=".DB_NAME."; DB_USER=".DB_USER."; DB_PASSWORD=".DB_PASSWORD."; DB_HOST=".DB_HOST); ')
SQL_COMMAND="mysql -u $DB_USER -h $DB_HOST -p$DB_PASSWORD $DB_NAME -e"
OLD_URL=$(mysql -u $DB_USER -h $DB_HOST -p$DB_PASSWORD $DB_NAME -e 'select option_value from wp_options where option_id = 1;' | grep http)
OLD_URL=$($SQL_COMMAND 'select option_value from wp_options where option_name = '"'"'home'"'"';' | grep http)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You just use option_name = "home" instead of option_name = '"'"'home'"'"'

@jsaintrocc
Copy link

This fix would also work if applied to the CF yaml for the lesson before using the ALB, "Using EFS with Wordpress".

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

2 participants