Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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:

// 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.

like image 462
Matt Sephton Avatar asked Nov 04 '22 13:11

Matt Sephton


1 Answers

Check two directives

1) request_order http://www.php.net/manual/en/ini.core.php#ini.request-order

2) variables_order http://www.php.net/manual/en/ini.core.php#ini.variables-order

like image 144
Amit Kriplani Avatar answered Nov 10 '22 17:11

Amit Kriplani