json.so Not Loading?

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Phil Fenstermacher

    json.so Not Loading?

    I've installed json.so using pecl and its in the right place, it is
    specified in the php.ini file, however when I run a script that calls
    either of the two json commands I get the "Fatal error: Call to
    undefined function json_encode()" error. I've restarted apache, and
    even restarted the entire machine that its running on. Permissions on
    the json.so file are the same as other libraries that are working.
    Any ideas?

  • Good Man

    #2
    Re: json.so Not Loading?

    Phil Fenstermacher <phillip.fenste rmacher@gmail.c omwrote in
    news:1181249339 .623046.226190@ m36g2000hse.goo glegroups.com:
    I've installed json.so using pecl and its in the right place, it is
    specified in the php.ini file, however when I run a script that calls
    either of the two json commands I get the "Fatal error: Call to
    undefined function json_encode()" error. I've restarted apache, and
    even restarted the entire machine that its running on. Permissions on
    the json.so file are the same as other libraries that are working.
    Any ideas?
    PHP on Linux needs to be recompiled with the "configure" command when you
    choose to add/remove extensions. The "php.ini" file won't do it.

    ie: in your PHP directory...

    prompt>: rm -f config.cache FIRST
    prompt>: make clean
    prompt>:
    ../configure --with-mysql --with-apxs=/usr/local/apache/bin/apxs --disable-
    debug --enable-ftp --enable-inline-optimization --enable-magic-quotes --
    enable-mbstring **(etc etc etc, but here is where your json extension would
    be enabled)***
    prompt>: make
    prompt>: make install

    then restart apache


    Comment

    • Toby A Inkster

      #3
      Re: json.so Not Loading?

      Good Man wrote:
      PHP on Linux needs to be recompiled with the "configure" command when you
      choose to add/remove extensions. The "php.ini" file won't do it.
      Not in my experience. I've downloaded binary extensions in the past, added
      them to php.ini and never had to rebuild the whole of PHP for it.

      My advice would be to check the output of phpinfo() -- in particular note
      the location of the php.ini file -- sometimes you'll end up with several
      php.ini files on your system, so you need to make sure that you've been
      editing the right one!

      --
      Toby A Inkster BSc (Hons) ARCS
      [Geek of HTML/SQL/Perl/PHP/Python/Apache/Linux]
      [OS: Linux 2.6.12-12mdksmp, up 104 days, 17:48.]

      URLs in demiblog

      Comment

      • Good Man

        #4
        Re: json.so Not Loading?

        Toby A Inkster <usenet200705@t obyinkster.co.u kwrote in
        news:q7mnj4-h76.ln1@ophelia .g5n.co.uk:
        Good Man wrote:
        >
        >PHP on Linux needs to be recompiled with the "configure" command when
        >you choose to add/remove extensions. The "php.ini" file won't do it.
        >
        Not in my experience. I've downloaded binary extensions in the past,
        added them to php.ini and never had to rebuild the whole of PHP for
        it.
        Perhaps my situation was unique, in that I needed to have the JPG library
        loaded for GD, which required a rebuild.

        Comment

        Working...