I recently moved my website into a new server , my database is perfectly configured but i keep getting this error and can't access my wp-admin
:
Use of undefined constant REQUEST_URI - assumed 'REQUEST_URI' in /www/docs/wordpress/wp-content/themes/twentyfifteen/functions.php on line 73
I get this error with every theme and even with all my plugins disabled .
Warning: Use of undefined constant REQUEST_URI – assumed ‘REQUEST_URI’ (this will throw an Error in a future version of PHP) The solution for this warning is very simple, all you have to do is include single or double quotes around the REQUEST_URI text, for example:
Fix - PHP Notice: Use of undefined constant. Fix – PHP Notice: Use of undefined constant. This is a common notice / warning that occurs whenever PHP has detected the usage of an undefined constant. In case you didn’t already know, a constant is a simple value that cannot change during the execution of a script. i.e.
If you are seeing the Warning for ' Use of undefined REQUEST_URI ' in your Apache server logs, don't worry. This can easily be fixed. Before jumping to the solution let's understand why PHP gives this warning. This is more of a syntax warning, which PHP is allowing for now as PHP is an easy-going language when it comes to syntax.
Show activity on this post. The error message is due to the unfortunate fact that PHP will implicitly declare an unknown token as a constant string of the same name. That is, it's trying to interpret this (note the missing quote marks): The only valid way this would be valid syntax in PHP is if there was previously a constant department defined.
$path = $_SERVER[‘HTTP_HOST’] . $_SERVER[REQUEST_URI];
to
$path = $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'];
Warning: Use of undefined constant REQUEST_URI - assumed 'REQUEST_URI' in /www/docs/wordpress/wp-content/themes/twentyfifteen/functions.php on line 73
The above error show on my site https://cartvela.org/ and I am changing
$path = $_SERVER[‘HTTP_HOST’] . $_SERVER[REQUEST_URI];
to
$path = $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'];
With that code adjustment, my site comes back and error is gone
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With