Solved

Wordpress site "looses" $_GET

Posted on 2016-10-14
11
55 Views
Last Modified: 2016-10-21
I have two WordPress sites : one is misbehaving.
When I run the site locally on my dev machine with a hosts entry pointing the domain to the local version my payment gateway module works perfectly.
When I run the same site from its server (using the same domain name) - the $_GET array is empty - despite there being parameters in the URL.
Everything for the two installations is identical
This script works as expected - $_GET shows parameters

<pre>
<?php
print_r($_GET);
?>
</pre>

Open in new window


If I place the following code into the site
file_put_contents("getlog.log", print_r($_GET, true), FILE_APPEND);

Open in new window

On my local machine - it shows values
On hosting server - empty

Any known issues where some settings could result in WordPress not seeing the $_GET?
0
Comment
Question by:Julian Hansen
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 7
  • 2
11 Comments
 
LVL 110

Expert Comment

by:Ray Paseur
ID: 41843680
0
 
LVL 58

Author Comment

by:Julian Hansen
ID: 41843707
Both sites use URL rewriting - .htaccess redirects everything to index.php

Just the one site (local) sees the $_GET the other looses it.

The only difference between the two is the server the site is hosted on.

Going to compare a phpinfo dump of the two sites to see if there is anything obvious there but thought I would put it out there in case someone has come across this one before.
0
 
LVL 83

Expert Comment

by:Dave Baldwin
ID: 41843862
For 'file_put_contents', you do have to have write permissions.  http://php.net/manual/en/function.file-put-contents.php
1
Salesforce Has Never Been Easier

Improve and reinforce salesforce training & adoption using WalkMe's digital adoption platform. Start saving on costly employee training by creating fast intuitive Walk-Thrus for Salesforce. Claim your Free Account Now

 
LVL 58

Author Comment

by:Julian Hansen
ID: 41843911
Yes - the file is being written just has
Array 
(
)

Open in new window

Whereas on the other site I get
Array
(
    [crypt] => @5fa02dd9f9018c3648c68daf12bb786a09741a6c9fd13f885c49dd7899412b3b832c4ff312edd0b96320bbc281ae64725517fca99c8b72a349f362ef381052e1870fcdf33cc6584a5ddc4c7c56d3005e205a1698308ad3eddb7d88490264ec66a30ca7c815b9f84611148e19eaaf0d373e3651182ffcfffcbda8ae147883b93712b3e59fb87b61ae265c7a8badf8f354ea01bcbca8a8f1e4fe5ef782a69494dd22d90e0af012e24123541b9a523dbb4b33a5576cb903d869bb600e04a1a88cbcba3b193dc511e809cca4fc15bbe1239496918938d0fc6b0a60b121216ae3665275b5daf5d66aedd565fd07b7d3affd0086ffa70bd755e8da9c48d3166e4248ea23b56544d3424c81d768645d2049be95a5a59514629a5641e3c88fca95a95531fc6760add04b7ecc83a7c19c92840cc46ac8f76601338b86781a2d6798bf3c0214b4b9c5e1eafe654974d8adb5346105c4e8d921278428b3a1d5210ce0add6ca08fe665f9618a417e395b4e3040dab2bd491624e4c4669a6b1819ac7851b90874888ebcdf1718d77ac1d0c09d883d24f
)

Open in new window

URL in both cases is identical - same domain same parameters - crypt value changes but that is because it is a different transaction.
0
 
LVL 58

Author Comment

by:Julian Hansen
ID: 41844945
Just moved the site to another hosting provider (1and1) - problem went away - so it looks like Crazy Domains is doing something odd on their side.

1and1 is where we are trying to move from
CrazyDomains was selected as an option

Any good recommendations for a hosting provider for a primarily UK based online business?
0
 
LVL 110

Assisted Solution

by:Ray Paseur
Ray Paseur earned 500 total points
ID: 41844969
The standard recommendations would be those that support the PHP community, some of these offer hosting.
http://php.net/thanks.php

I've had good experiences with ChiHost, LiquidWeb, and HostGator.  I've had sub-optimal experiences with GoDaddy and 1and1.  Never heard of CrazyDomains before, but the name alone is enough to discourage.

BlueHost is well thought-of, but I have no direct experience with them.  Same with DreamHost.

Any cloud service is worth considering.  AWS might be a good answer.
0
 
LVL 58

Author Comment

by:Julian Hansen
ID: 41844984
Thanks Ray,

A smaller list to deal with - I will pass it on as I am not in the driving seat on this one.
0
 
LVL 58

Author Comment

by:Julian Hansen
ID: 41846214
Meant to give Ray points but seems it assigned him 0 - need to change that
0
 
LVL 58

Accepted Solution

by:
Julian Hansen earned 0 total points
ID: 41846215
Found the problem - ISP INI file did not allow for long requests
SuHoShin was the culprit - max_value_length was not long enough to accommodate the return
suhosin.simulation = On 
suhosin.post.max_vars = 4096 
suhosin.request.max_vars = 4096 
suhosin.get.max_value_length = 4096
suhosin.session.encrypt = Off 

Open in new window

0
 
LVL 58

Author Closing Comment

by:Julian Hansen
ID: 41853475
The actual solution to the problem was my post.

However, having resolved to move to a different ISP Ray provided good advice on where to go.
0

Featured Post

Why Off-Site Backups Are The Only Way To Go

You are probably backing up your data—but how and where? Ransomware is on the rise and there are variants that specifically target backups. Read on to discover why off-site is the way to go.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I annotated my article on ransomware somewhat extensively, but I keep adding new references and wanted to put a link to the reference library.  Despite all the reference tools I have on hand, it was not easy to find a way to do this easily. I finall…
There are times when I have encountered the need to decompress a response from a PHP request. This is how it's done, but you must have control of the request and you can set the Accept-Encoding header.
The purpose of this video is to demonstrate how to exclude a particular blog category from the main blog page. This is can be used when a category already has its own tab, or you simply want certain types of posts not to show up on the main blog. …
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …

632 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question