PHP using old JSON extension (1.2.1). How to upgrade to json-c
Currently PHP build with EA3 is using json version 1.2.1. This is causing problems encoding specific string which contain a tab for instance. json_decode in php will return null. Now I want to use jsonc as it is the superseeding extension for json. Is there a way to do this? I tried manually but that's a no go.
Thanks in advance.
-
Hello :) What method did you use when attempting to install it? Have you tried installing it as a PECL module? EX: PECL :: Package :: jsonc Thank you. 0 -
Hi, Thank you for your reply. I manually downloaded jsonc from pecl.php.net and installed it. phpize ./configure make make install The extension json.so was installed in the proper extension directory. I added extension=json.so to php.ini which was used by php running php --ini. Next I checked the version by running php --ri json which told me it was still using 1.2.1. I ran out of ideas here.:( 0 -
Additional info: Using the Cpanel PECL module installer gave an error. mkdir: cannot create directory `json-c/.libs': No such file or directory make: *** [json-c/arraylist.lo] Error 1 0 -
Hi, Even if you have the PECL jsonc, you still need the jsonc libraries to back it up. It looks like you need to install it from here: GitHub - json-c/json-c: Official code repository for json-c. See the wiki for release tarballs for download. 0 -
I did install json-c before even attempting to build the extension. I would expect php to throw errors. The make tests fail for the jsonc extension. I h ave a feeling I have to rebuild PHP entirely to benefit from the new json-c library? I get: Warning: Module 'json' already loaded in Unknown on line 0 all the time. I assume because json is part of PHP's core? 0 -
This may be right. I'd suggest taking this to ##php on freenode (IRC) and see if they can assist. This looks to be an environment issue if nothing else: PHP :: Bug #66189 :: pecl install jsonc fails during compilation 0 -
Alright, will do. Thank you for your help. 0
Please sign in to leave a comment.
Comments
7 comments