Site logo

Archived topic

Warning: Use of undefined constant REQUEST_URI

3 replies · Started by Nasif on January 9, 2019

Viewing posts 1–4 of 4

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

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!

This archived topic is closed to new replies.