[Support request] Warning: Use of undefined constant REQUEST_URI

Home Forums Support [Support request] Warning: Use of undefined constant REQUEST_URI

Home Forums Support Warning: Use of undefined constant REQUEST_URI

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #777538
    Nasif

    Hi,
    I am getting this error in my website:

    Warning: Use of undefined constant REQUEST_URI – assumed ‘REQUEST_URI’ (this will throw an Error in a future version of PHP) in /home/xx/xx/wp-content/themes/generatepress/functions.php on line 73

    Let me know how I can fix this.

    Thanks

    #777712
    Leo
    Staff
    Customer Support

    Hi there,

    Weird. Also see lots of console errors as well:
    https://www.screencast.com/t/Xnmcjb8kb48D

    Can you try #1 here to eliminate any plugin conflicts first?
    https://docs.generatepress.com/article/debugging-tips/

    Let me know 🙂

    #1088557
    mertusta

    It is probably too late to answer but I just had the exact problem and solved quickly. Just in case if anyone is looking for the solution this is how I handled:

    $path = $_SERVER['HTTP_HOST'] . $_SERVER[REQUEST_URI];

    changed to;

    $path = $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'];

    Basically my functions.php line 73 was missing apostrophe (or whatever it is) on REQUEST_URI part. Don’t know what caused it but this is how I solved. Cheers!

    #1090151
    Tom
    Lead Developer
    Lead Developer

    Just a heads up that that code shouldn’t exist in functions.php: https://github.com/tomusborne/generatepress/blob/2.4.1/functions.php

    If it’s from a custom function you’ve added, you should use one of these methods instead: https://docs.generatepress.com/article/adding-php/

Viewing 4 posts - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.