InMotion Hosting Support Center


2012-05-22 11:36 am EST

Hits: 1,088
Do you guys have some old json extension bundled with PHP? I have the same version of PHP on my local machine that you have. Everything else is the same (all my needed libs are uploaded). But your PHP does not correctly decode my JSON and mine DOES decode it correctly. Also, my JSON validates as "valid JSON" on the site.
This is not acceptable behavior.

You must login before you can ask a follow up question.

You must login before you can submit an answer.

Good Evening,

I have the same issue mentioned by kleeh. I have a local host installed at my own machine and everything works fine. When I migrated the server php files to Inmotion, json stopped working. I thought it could be related to internet connection and I decided to upload the client files as well. The problem persisted.
I debugged and found:

String sent to server :

[{"vitima_id":1,"ocorrencia_id":1,"nome":"Bradesco","sexo":"Feminino","fase":"Pessoa em vida","iml":"Não encaminhado","paf":"nao","observacao":""}]

String received on server:



[{"vitima_id":1,"ocorrencia_id":1,"nome":"Bradesco","sexo":"Feminino","fase":"Pessoa em vida","iml":"Não encaminhado","paf":"nao","observacao":""

I have 10 tables being updated and only one worked. The issue is always at the end of transmission, missing characters and sometimes with the symbol "%" at the end.

Do we have to do some special configuration in php to correctly receive json strings from client side?
0 Points
2016-03-07 10:05 pm EST



5,399 Points
2012-05-22 11:59 am EST
Hi kleeh,

I agree with your statement that "it is not acceptable behavior" for your server's PHP JSON extension to not encode / decode correctly. There are many factors involved, but hopefully we can find what the issue is at hand.

I have a bit of experience myself using JSON, which should help here. We do need a little more information from you before we can troubleshoot further.

<strong>But your PHP does not correctly decode my JSON and mine DOES decode it correctly. Also, my JSON validates as "valid JSON" on the site.</strong>

Why doesn't it decode it correctly? Can you give us an example of what it looks like and what it should look like? For the sake of this question, it may be easier if you use <a href='' target='_blank'>pastebin</a> to upload the examples, and then give us a link to your content.

We look forward to hearing from you! Feel free to either update your question or post a comment at the bottom of this page with more details.

- Brad

You must login before you can post a comment about this answer.

Like this Question?

Forum Login

You are NOT logged in. You can still browse our Support Center.

To participate within our Community Support Forum:

Need more Help?

Ask the Community!

Get help with your questions from our community of like-minded hosting users and InMotion Hosting Staff.

Current Customers

Chat: Click to Chat Now E-mail:
Call: 888-321-HOST (4678) Ticket: Submit a Support Ticket

Not a Customer?

Get web hosting from a company that is here to help. Sign up today!