Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Trying to run this from the browser or as shown here with curl

I get a response of �zرy��a�a�a�a�a�a�a�a�aBEE�

It's an ubuntu 10.04 server running apache2 The data that is suppose to come back should be a JSON string { result: "true" } or something of that sort so I don't think it's something wrong with the charset/encoding in the database.

> GET /ajax.php?f=setCurrency HTTP/1.1
> User-Agent: curl/7.19.7 (x86_64-pc-linux-gnu) libcurl/7.19.7 OpenSSL/0.9.8k zlib/ libidn/1.15
> Host: 
> Accept: */*
> X-Requested-With: XMLHttpRequest
< HTTP/1.1 200 OK
< Date: Thu, 06 Jun 2013 15:07:35 GMT
< Server: Apache/2.2.14 (Ubuntu)
< X-Powered-By: PHP/5.3.2-1ubuntu4.19
< Content-Encoding: none
< Content-Length: 30
< Content-Type: text/html
* Connection #0 to host left intact
* Closing connection #0


[1]+  Done
share|improve this question

closed as off topic by Michael Hampton Jun 10 '13 at 8:39

Questions on Server Fault are expected to relate to server, networking, or related infrastructure administration within the scope defined by the community. Consider editing the question or leaving comments for improvement if you believe the question can be reworded to fit within the scope. Read more about reopening questions here.If this question can be reworded to fit the rules in the help center, please edit the question.

This is almost certainly a problem with your web application, not with your server setup. – Michael Hampton Jun 6 '13 at 19:47

Essentially the problem was that when you wrap in PHP 5.3 json_encode(true) and expect a json response it sometimes return a malformed response.

share|improve this answer

Try to add «Accept-Encoding:» to your request headers to ensure that you arent getting compressed data in return.

The «Content-Encoding» header do look OK, but one never knows what silly web servers might do.

share|improve this answer

Not the answer you're looking for? Browse other questions tagged or ask your own question.