I recognize this error message from here:
So I think the reason your JSON cannot be parsed is because your code is returning the database error message which is not valid JSON data.
And this error message is caused by using the database hostname localhost
, instead of the hostname that’s shown in the client area and control panel.
This would also explain why your code works on other hosting providers: must providers use localhost
for the database hostname. But you’ll need to change that setting to connect to your database here.
Besides this, I see absolutely no problem in hosting your website!