Jump to content

Is there a way to run PW without json?


neildaemond
 Share

Recommended Posts

My client got their web hosting from a terrible company who poses as IT consultants but really just act as middle men, reselling the cheap web hosting they purchase from a legitimate company... it is VERY frustrating.

Anyways, my site won't load and gives the errors that it can't find the json_decode() function.

I tried installing a fresh PW, and the checks gave the errors that json support and the php was slightly outdated.

but in the end it installed, but got errors on load. same as when I load my pages.

So, is there a way to hack pw so that it doesn't require json support? I tried asking the "IT Consultants" to install json, but they wouldn't. I even gave them the list of command that would do it for them. They obviously don't even have root access to their servers. so lame.

Link to comment
Share on other sites

I don't think you want to take that route, as it is used by many things, mostly javascripts. Too much, if you ask me, to change. Not sure. Changing host is the best solution. Or maybe there's a workaround to implement that functionality using a class, but not even sure if that would work.

Link to comment
Share on other sites

Thanks alot for your help guys. I added json support by mashing up two solutions from:

http://www.epigroove.com/posts/97/how_to_use_json_in_php_4_or_php_51x

http://techblog.willshouse.com/2009/06/12/using-json_encode-and-json_decode-in-php4/

Where from the first link, I got the nice script which I could place inside the ../core/Functions.php:

if (!function_exists('json_decode')) {

function json_decode($content, $assoc=false) {

require_once 'classes/JSON.php';

if ($assoc) {

$json = new Services_JSON(SERVICES_JSON_LOOSE_TYPE);

}

else {

$json = new Services_JSON;

}

return $json->decode($content);

}

}

if (!function_exists('json_encode')) {

function json_encode($content) {

require_once 'classes/JSON.php';

$json = new Services_JSON;

return $json->encode($content);

}

}

just changing the 'require_once' to point at the JSON.php which I got from a link within the second solution(this way I didn't have to install pear, which I was unsuccessful doing):

http://mike.teczno.com/JSON/JSON.phps

I renamed JSON.phps to JSON.php

... so the json errors no longer appeared.

HOWEVER,

Since the host only uses php 5.19, I got many other errors. After Complaining to my 'web host', they just said they aren't responsible for third party software support. They will move me to another server which uses php 5.2.3, so hopefully things work out for that~ even though pw's requirement says 5.2.4

cross fingers~

Link to comment
Share on other sites

Neil, thanks for posting the JSON solution you used.

Regarding PHP versions: not even WordPress will run in PHP prior to 5.2.4. Some big red flags at that web host… run away! :)

  • Like 1
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...