The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

PHP using old JSON extension (1.2.1). How to upgrade to json-c

Discussion in 'EasyApache' started by Visualq, Mar 12, 2016.

  1. Visualq

    Visualq Member

    Joined:
    May 12, 2012
    Messages:
    13
    Likes Received:
    0
    Trophy Points:
    1
    cPanel Access Level:
    Root Administrator
    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.
     
  2. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    30,854
    Likes Received:
    676
    Trophy Points:
    113
    cPanel Access Level:
    Root Administrator
  3. Visualq

    Visualq Member

    Joined:
    May 12, 2012
    Messages:
    13
    Likes Received:
    0
    Trophy Points:
    1
    cPanel Access Level:
    Root Administrator
    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.:(
     
  4. Visualq

    Visualq Member

    Joined:
    May 12, 2012
    Messages:
    13
    Likes Received:
    0
    Trophy Points:
    1
    cPanel Access Level:
    Root Administrator
    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
     
  5. cPJacob

    cPJacob cPanel Product Owner
    Staff Member

    Joined:
    May 2, 2014
    Messages:
    510
    Likes Received:
    66
    Trophy Points:
    28
    cPanel Access Level:
    DataCenter Provider
    Twitter:
  6. Visualq

    Visualq Member

    Joined:
    May 12, 2012
    Messages:
    13
    Likes Received:
    0
    Trophy Points:
    1
    cPanel Access Level:
    Root Administrator
    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?
     
  7. cPJacob

    cPJacob cPanel Product Owner
    Staff Member

    Joined:
    May 2, 2014
    Messages:
    510
    Likes Received:
    66
    Trophy Points:
    28
    cPanel Access Level:
    DataCenter Provider
    Twitter:
  8. Visualq

    Visualq Member

    Joined:
    May 12, 2012
    Messages:
    13
    Likes Received:
    0
    Trophy Points:
    1
    cPanel Access Level:
    Root Administrator
    Alright, will do. Thank you for your help.
     
Loading...

Share This Page