-->
Home -> PHP -> How to install JSON on Linux server

How to install JSON on Linux server

4
Nov
2011
0

If you would use JSON to get data from your Linux Server, but you encounter this error:

Error: PHP Fatal error:
Call to undefined function json_encode()

The problem is that when PHP 5.2 version supports natively json functions ( json_encode() and json_decode() ), the previous version PHP 5.0 doesn’t support JSON.

Solution 1: Install JSON on PHP 5.0

# yum install php-pear gcc
# pecl install json
# cd /etc/php.d
# echo "extension=json.so" >> json.ini
# /etc/init.d/httpd restart

Solution 2: Upgrade your PHP version to 5.2

Condividi:
  • Digg
  • del.icio.us
  • Facebook
  • Google Bookmarks
  • MySpace
  • Technorati
  • Twitter
:,

Commenti

Lascia il tuo commento:

Cerchi qualcosa?

Usa questo form per cercare argomenti in questo blog:

Non riesci a trovare quello che cerchi? Lascia un commento in un post oppure contattami per risolvere il problema!

Puoi trovarmi su Twitter come @superbre