How to install JSON on Linux server
4
Nov
20110
Nov
20110
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











Commenti