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. Everything runs perfectly.

Since moving to the client server, certain functions in the editor have stopped working. Specifically, those involving ajax requests. I have looked into things and it’s exiting with die(0) in admin-ajax.php at the following code:

Read More
// 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:

$_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?

If I edit ajax-admin.php to add the $_REQUEST reset:

$_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.

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
PHP 5.4.5 using Apache 2.0 Handler
Unix server

PHP settings:
request_order: no value
variables_order: GPCS

Any help appreciated.

Related posts

Leave a Reply

2 comments

  1. Verify your php.ini configuration. There is an option request_order that must be set to “On” and Value to be “GP” for Get and Post.

    It’s turned off.. But here’s what mine looks like on my local ini from WAMP.

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