• After setting up an Amazon Elastic Load Balancer, where SSL terminates, I was getting Mixed Content errors on the site, until I added the following line to wp-config.php.

    if (strpos($_SERVER['HTTP_X_FORWARDED_PROTO'], 'https') !== false)
    $_SERVER['HTTPS']='on';

    While this fixed the Mixed Content errors, now I get this PHP Notice after using wp-cli:

    PHP Notice: Undefined index: HTTP_X_FORWARDED_PROTO in phar:///opt/bitnami/apps/wordpress/bin/wp-cli.phar/vendor/wp-cli/wp-cli/php/WP_CLI/Runner.php(1169) : eval()'d code on line 81

    What should I do?

Viewing 1 replies (of 1 total)
  • Moderator bcworkz

    (@bcworkz)

    Try inserting array_key_exists('HTTP_X_FORWARDED_PROTO', $_SERVER) && in front of the strpos() conditional.

Viewing 1 replies (of 1 total)

The topic ‘wp-cli PHP Notice after moving server behind Load Balancer’ is closed to new replies.