Title: Polylang breaks command line execution.
Last modified: April 17, 2021

---

# Polylang breaks command line execution.

 *  [JS Morisset](https://wordpress.org/support/users/jsmoriss/)
 * (@jsmoriss)
 * [5 years, 1 month ago](https://wordpress.org/support/topic/polylang-breaks-command-line-execution/)
 * FYI, when executing WordPress from the command line:
 * Notice: $_SERVER[‘HTTP_HOST’] or $_SERVER[‘REQUEST_URI’] are required but not
   set. in /…/wordpress/wp-content/plugins/polylang/include/functions.php on line
   87
 * js.

Viewing 4 replies - 1 through 4 (of 4 total)

 *  Plugin Author [Chouby](https://wordpress.org/support/users/chouby/)
 * (@chouby)
 * [5 years, 1 month ago](https://wordpress.org/support/topic/polylang-breaks-command-line-execution/#post-14336259)
 * Hello,
 * WordPress uses these superglobals frequently. See [https://github.com/WordPress/WordPress/search?q=request_uri](https://github.com/WordPress/WordPress/search?q=request_uri)
   and [https://github.com/WordPress/WordPress/search?q=http_host](https://github.com/WordPress/WordPress/search?q=http_host).
   That’s the same for Polylang. You must ensure that they are populated to avoid
   these notices.
    Note that for WP CLI, Polylang already works around the issue
   and doesn’t display any notice: [https://github.com/polylang/polylang/blob/3.0.3/include/functions.php#L76-L83](https://github.com/polylang/polylang/blob/3.0.3/include/functions.php#L76-L83)
 *  Thread Starter [JS Morisset](https://wordpress.org/support/users/jsmoriss/)
 * (@jsmoriss)
 * [5 years, 1 month ago](https://wordpress.org/support/topic/polylang-breaks-command-line-execution/#post-14336732)
 * I mean executing WordPress and PHP from the command line, not using the WP CLI
   package, which is another way to execute WP from the command line, but certainly
   not the only way. When executing WordPress and PHP from the command line, a HTTP_HOST
   and REQUEST_URI value is not possible as there is no HTTP connection and no HTTP
   request.
 * js.
 *  Plugin Author [Chouby](https://wordpress.org/support/users/chouby/)
 * (@chouby)
 * [5 years, 1 month ago](https://wordpress.org/support/topic/polylang-breaks-command-line-execution/#post-14340224)
 * > not possible
 * Haven’t you a wp-config file?
 * I perfectly understood that you are not using WP CLI. Otherwise Polylang would
   not display any warning.
 * As explained above, we cover WP CLI because we know it. We cannot cover other
   cases. The same way WP doesn’t cover them if it happens that some part of the
   code using these variables is executed while they are not defined. Maybe you 
   haven’t any notice in WP, but as the search results I linked to in my previous
   answer demonstrate, that was pure luck. You must fill theses variables yourself
   to avoid notices in Polylang **and** WP.
 *  Thread Starter [JS Morisset](https://wordpress.org/support/users/jsmoriss/)
 * (@jsmoriss)
 * [5 years, 1 month ago](https://wordpress.org/support/topic/polylang-breaks-command-line-execution/#post-14341767)
 * The $_SERVER variable is provided by a web server, not WordPress or PHP. When
   using WordPress and PHP from the command line, a web server is not used, so those
   variables are not defined.
 * js.

Viewing 4 replies - 1 through 4 (of 4 total)

The topic ‘Polylang breaks command line execution.’ is closed to new replies.

 * ![](https://ps.w.org/polylang/assets/icon-256x256.png?rev=3433336)
 * [Polylang](https://wordpress.org/plugins/polylang/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/polylang/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/polylang/)
 * [Active Topics](https://wordpress.org/support/plugin/polylang/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/polylang/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/polylang/reviews/)

 * 4 replies
 * 2 participants
 * Last reply from: [JS Morisset](https://wordpress.org/support/users/jsmoriss/)
 * Last activity: [5 years, 1 month ago](https://wordpress.org/support/topic/polylang-breaks-command-line-execution/#post-14341767)
 * Status: not resolved