MyBB Internal: One or more warnings occured. Please contact your administrator for assistance.
WebPagetest Forums - json_response returns nothing

WebPagetest Forums

Full Version: json_response returns nothing
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hi,

I just find sometimes jsonResult.php can't return json result correctly, but nothing.(html and xml results work perfectly)
For example: The path is jsonResult.php?test=151229_ZR_Z4

in jsonResult.php file, I can see:
json_response($ret);
I var_dump($ret) and get a large array, but json_response($ret) returns nothing.

I guess it's because the size of my array is too big, and json_encode can't accept the large array.

Maybe it's a bug, is there a quick solution to solve it?
Thanks
Is this for a private instance of WPT? If so, check your error logs.
(12-30-2015 04:16 PM)josephscott Wrote: [ -> ]Is this for a private instance of WPT? If so, check your error logs.

Hi, thanks for reply. yes, it's a private instance.
it's a good idea. but there is nothing in the error log.
I added json_last_error() in the jsonResult.php, and got the output is 5, which is JSON_ERROR_UTF8

After I utf8_encode the array, json_response finally output the json.
Some non-UTF8 items in there some where then? May be worth tracking down the source of that.
(12-31-2015 03:03 AM)josephscott Wrote: [ -> ]Some non-UTF8 items in there some where then? May be worth tracking down the source of that.

oh, sorry, I forget to add some words at the first: json_response doesn't always return nothing, just seldom.

At beginning, I thought there are some special characters in the array items. But, I use mb_detect_encoding and find almost all the items in the array are in ASCII
for example:
151227_DE_CB
1500
Sun, 27 Dec 2015 07:33:00 +0000

all of them are in ASCII
Reference URL's