[wp-trac] [WordPress Trac] #44569: SERVER_NAME undefined index in WP CLI

WordPress Trac noreply at wordpress.org
Wed Jul 11 14:12:03 UTC 2018


#44569: SERVER_NAME undefined index in WP CLI
--------------------------+------------------------
 Reporter:  displaynone   |       Owner:  (none)
     Type:  defect (bug)  |      Status:  closed
 Priority:  normal        |   Milestone:
Component:  Mail          |     Version:  4.9.7
 Severity:  normal        |  Resolution:  duplicate
 Keywords:                |     Focuses:
--------------------------+------------------------
Changes (by swissspidy):

 * status:  new => closed
 * resolution:   => duplicate
 * component:  General => Mail
 * milestone:  Awaiting Review =>


Comment:

 Howdy!

 That line comes from `wp_mail()`, which is known to have issues with using
 `$_SERVER['SERVER_NAME']`. See #25239.

 I'm therefore closing this ticket as a duplicate, because to really solve
 this, we'd have to stop using that variable. That ticket proposes exactly
 this.

 You can prevent this from happening by explicitly setting the site URL in
 your `wp-cli.yml` configuration:
 https://make.wordpress.org/cli/handbook/config/ or perhaps by setting
 `$_SERVER['SERVER_NAME']` in your `wp-config.php` in case it's not set
 (which is the case when using CLI)

 See also the WP-CLI FAQ entry on that matter:
 https://make.wordpress.org/cli/handbook/common-issues/#php-notice-
 undefined-index-on-_server-superglobal

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/44569#comment:2>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list