SitePoint Sponsor

User Tag List

Results 1 to 8 of 8
  1. #1
    SitePoint Guru
    Join Date
    Mar 2004
    Posts
    639
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Can't install JSON extension

    Hello guys,

    I need to install PHP 5.2.3 with JSON support.

    I've downloaded latest PHP 5.2.3. Then I configured PHP with JSON:

    ./configure --build=x86_64-redhat-linux-gnu --host=x86_64-redhat-linux-gnu --target=x86_64-redhat-linux-gnu --program-prefix= --prefix=/usr --exec-prefix=/usr --bindir=/usr/bin --sbindir=/usr/sbin --sysconfdir=/etc --datadir=/usr/share --includedir=/usr/include --libdir=/usr/lib64 --libexecdir=/usr/libexec --localstatedir=/var --sharedstatedir=/usr/com --mandir=/usr/share/man --infodir=/usr/share/info --cache-file=../config.cache --with-libdir=lib64 --with-config-file-path=/etc --with-config-file-scan-dir=/etc/php.d --disable-debug --with-pic --disable-rpath --with-pear --with-bz2 --with-curl --with-exec-dir=/usr/bin --with-freetype-dir=/usr --with-png-dir=/usr --enable-gd-native-ttf --without-gdbm --with-gettext --with-gmp --with-iconv --with-jpeg-dir=/usr --with-openssl --with-png --with-expat-dir=/usr --with-pcre-regex=/usr --with-zlib --with-layout=GNU --enable-exif --enable-ftp --enable-magic-quotes --enable-sockets --enable-sysvsem --enable-sysvshm --enable-sysvmsg --enable-track-vars --enable-trans-sid --enable-yp --enable-wddx --with-kerberos --enable-ucd-snmp-hack --with-unixODBC=shared,/usr --enable-memory-limit --enable-shmop --enable-calendar --enable-dbx --enable-dio --with-mime-magic=/usr/share/file/magic --without-sqlite --with-libxml-dir=/usr --with-xml --without-mysql --without-gd --without-odbc --disable-dom --disable-dba --without-unixODBC --disable-pdo --disable-xmlreader --disable-xmlwriter --with-json
    Then I made "make", "make install", "make clean". Now I have PHP 5.2.3 installed, but JSON function do not work.

    For example, when I try to use json_decode() function, I get error:

    Fatal error: Call to undefined function json_decode()...
    I wonder how can I fix this?

  2. #2
    play of mind Ernie1's Avatar
    Join Date
    Sep 2005
    Posts
    1,252
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Make sure to add an extension=json.so line to your php.ini/php.d
    restart the server
    my mobile portal
    ghiris.ro

  3. #3
    SitePoint Guru
    Join Date
    Mar 2004
    Posts
    639
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Ernie1 View Post
    Make sure to add an extension=json.so line to your php.ini/php.d
    restart the server
    Thanks for advice.

    I put this line into the php.ini and restartd server, but I still get the error.

  4. #4
    play of mind Ernie1's Avatar
    Join Date
    Sep 2005
    Posts
    1,252
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Download http://aurore.net/projects/php-json/...-1.2.0.tar.bz2
    ./configure, make, make install
    move .so file from where it was install to php extension directory (The make program should automatically copy it to the extensions folder if it is using a standard location. If it does not, your extension directory is specified in the php.ini file by the extension_dir setting)
    the new extension is called json.so. Add a line to php.ini
    extension=json.so
    my mobile portal
    ghiris.ro

  5. #5
    SitePoint Guru
    Join Date
    Mar 2004
    Posts
    639
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Ernie1 View Post
    Download http://aurore.net/projects/php-json/...-1.2.0.tar.bz2
    ./configure, make, make install
    move .so file from where it was install to php extension directory (The make program should automatically copy it to the extensions folder if it is using a standard location. If it does not, your extension directory is specified in the php.ini file by the extension_dir setting)
    the new extension is called json.so. Add a line to php.ini
    extension=json.so
    When I try to ./configure, I get error message:

    -bash: ./configure: No such file or directory

    But when I ./configure PHP 5.2.3 for example, I have no any problems.

  6. #6
    SitePoint Guru
    Join Date
    Mar 2004
    Posts
    639
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I wonder, why doesn't JSON work in PHP 5.2.3? I mean 5.2.x have built in JSON functions:

    The key features of PHP 5.2.0 include:
    ....
    JSON extension was added and enabled by default
    ....

    http://www.php.net/releases/5_2_0.php
    I wonder why it doesn't work if it should be enabled by default in PHP 5.2.x?

  7. #7
    play of mind Ernie1's Avatar
    Join Date
    Sep 2005
    Posts
    1,252
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I found out by doing a google search, that JSON support is built into PHP 5.2.3
    my mobile portal
    ghiris.ro

  8. #8
    SitePoint Guru
    Join Date
    Mar 2004
    Posts
    639
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Ernie1 View Post
    I found out by doing a google search, that JSON support is built into PHP 5.2.3
    Yes, I wrote about that in my previous post.

    But when I call json_decode() function, I get error message.

    How can I fix it?


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •