使用未定义的常量 REQUEST_URI - 在第 73 行的functions.php 中假定为“REQUEST_URI”
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/50333864/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Use of undefined constant REQUEST_URI - assumed 'REQUEST_URI' in functions.php on line 73
提问by user3501194
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
:
我最近将我的网站移到了新服务器上,我的数据库已完美配置,但我不断收到此错误并且无法访问我的wp-admin
:
Use of undefined constant REQUEST_URI - assumed 'REQUEST_URI' in /www/docs/wordpress/wp-content/themes/twentyfifteen/functions.php on line 73
使用未定义的常量 REQUEST_URI - 在第 73 行的 /www/docs/wordpress/wp-content/themes/twentyfifteen/functions.php 中假定为“REQUEST_URI”
I get this error with every theme and even with all my plugins disabled .
我在每个主题中都会遇到此错误,即使我的所有插件都已禁用。
回答by Babu
$path = $_SERVER[‘HTTP_HOST'] . $_SERVER[REQUEST_URI];
to
到
$path = $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'];
回答by Rashid Mehmood
Warning: Use of undefined constant REQUEST_URI - assumed 'REQUEST_URI' in /www/docs/wordpress/wp-content/themes/twentyfifteen/functions.php on line 73
警告:使用未定义的常量 REQUEST_URI - 在第 73 行的 /www/docs/wordpress/wp-content/themes/twentyfifteen/functions.php 中假定为“REQUEST_URI”
The above error show on my site https://cartvela.org/and I am changing
以上错误显示在我的网站https://cartvela.org/ 上,我正在更改
$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
通过该代码调整,我的网站回来了,错误消失了
回答by user2600312
Be very careful when this warning occures because this can be a side effect of the wp-vcd.phpmalware. Check if the file wp-includes\wp-vcd.phpexists. If yes, you are infected and you should not fix this warning but instead reinstall wordpress. And avoid installing nulled themes/plugins.
出现此警告时要非常小心,因为这可能是wp-vcd.php恶意软件的副作用。检查文件wp-includes\wp-vcd.php 是否存在。如果是,则您已被感染,您不应修复此警告,而应重新安装 wordpress。并避免安装无效的主题/插件。
回答by real vishal
Convert
转变
$path = $_SERVER[‘HTTP_HOST'] . $_SERVER[REQUEST_URI];
to
到
$path = $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'];
回答by shajar hussain
Edit the file
C:\xampp\htdocs\ngn.com\wp-content\themes\mts_splash\functions.php
, proceed to line 73 and look forREQUEST_URI
. Put single quotes around it (REQUEST_URI
) and save the file.Proceed to
WordPress
and tell them about that problemNext time, proceed to
WordPress
immediately, as this is not aXampp
issue, its aWordPress
issue.
编辑文件
C:\xampp\htdocs\ngn.com\wp-content\themes\mts_splash\functions.php
,继续第 73 行并查找REQUEST_URI
. 在它周围REQUEST_URI
加上单引号 ( ) 并保存文件。继续
WordPress
并告诉他们这个问题下一次,
WordPress
立即进行,因为这不是Xampp
问题,而是WordPress
问题。