简体   繁体   English

在PHP服务器设置中会导致$ _REQUEST为空?

[英]what in PHP server setup would cause $_REQUEST to be empty?

I've been developing a WordPress site on my local machine and hosting on my own server. 我一直在我的本地机器上开发一个WordPress站点并在我自己的服务器上托管。 Everything runs perfectly. 一切都运行得很好。

Since moving to the client server, certain functions in the editor have stopped working. 自从移动到客户端服务器后,编辑器中的某些功能已停止工作。 Specifically, those involving ajax requests. 具体来说,涉及ajax请求的那些。 I have looked into things and it's exiting with die(0) in admin-ajax.php at the following code: 我已经查看了一些东西,它在admin-ajax.php中以die(0)退出,代码如下:

// Require an action parameter
if ( empty( $_REQUEST['action'] ) )
    die( '0' );

further reading sees $_REQUEST being reset during wp_magic_quotes() in wp-includes/load.php as follows: 进一步阅读看到$_REQUESTwp-includes/load.php中的wp_magic_quotes()期间被重置,如下所示:

$_REQUEST = array_merge( $_GET, $_POST );

What might be the issue with the PHP setup on the server that might make $_REQUEST remain blank after wp_magic_quotes() during ajax-admin.php ? ajax-admin.php期间,在wp_magic_quotes()之后,服务器上的PHP设置可能会导致$_REQUEST保持空白可能是什么问题?

If I edit ajax-admin.php to add the $_REQUEST reset: 如果我编辑ajax-admin.php来添加$_REQUEST重置:

$_REQUEST = array_merge( $_GET, $_POST );

// Require an action parameter
if ( empty( $_REQUEST['action'] ) )
    die( '0' );

...then everything ajax in the editor works as it should. ...然后编辑器中的所有ajax都应该正常工作。

But I would rather not edit core files, so would like to know how I can change the server setup to get things working with the standard files? 但我宁愿不编辑核心文件,所以想知道如何更改服务器设置以使标准文件正常工作?

Setup Details: 设置细节:
Wordpress 3.4.2 Wordpress 3.4.2
PHP 5.4.5 using Apache 2.0 Handler PHP 5.4.5使用Apache 2.0 Handler
Unix server Unix服务器

PHP settings: PHP设置:
request_order: no value request_order:没有价值
variables_order: GPCS variables_order:GPCS

Any help appreciated. 任何帮助赞赏。

Verify your php.ini configuration. 验证您的php.ini配置。 There is an option request_order that must be set to "On" and Value to be "GP" for Get and Post. 有一个选项request_order必须设置为“On”,并且Value为“GP”,用于Get和Post。

It's turned off.. But here's what mine looks like on my local ini from WAMP. 它关闭了..但是这是我在WAMP当地的ini看起来的样子。

; request_order
;   Default Value: None
;   Development Value: "GP"
;   Production Value: "GP"

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM