Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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/1.2.3.3 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 www.tellavista.com left intact
* Closing connection #0

�zرy��a�a�a�a�a�a�a�a�aBEE�

[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 professional 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
add comment

2 Answers

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
add comment

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
add comment

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