• JS Morisset

    (@jsmoriss)


    I keep getting the following errors when running WP 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
    

    Is there a way to avoid these errors?

    js.

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author Chouby

    (@chouby)

    Hello,

    I suggest that you contact your host provider to report the issue. These variables are expected to be filled by the server which seems not the case on your install. This is probably due to a wrong server config. Polylang requires these variables to work correctly.

    Note that they are also used by WordPress itself in many places. See the result of the search for one of them in the WordPress code: https://github.com/WordPress/WordPress/search?q=REQUEST_URI

    Thread Starter JS Morisset

    (@jsmoriss)

    Since WordPress is being run from the command line, there’s no web server.

    Your plugin is the only one complaining about these variables – I’m guessing that you are checking them before they are actually needed. If you were to check them where they are needed, then there probably wouldn’t be an issue since that code probably would never be reached – PolyLang appears to be checking these variables on load, not during execution.

    js.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Notice: $_SERVER[‘HTTP_HOST’] or $_SERVER[‘REQUEST_URI’] are required’ is closed to new replies.