Home > Article > Backend Development > Why is PHP throwing a \"Fatal error: Call to undefined function json_decode()\" in PHP 5.5.1-2 on Ubuntu?
Problem:
PHP is throwing a fatal error indicating that the json_decode() function is undefined, despite running PHP version 5.5.1-2.
Answer:
If you're using Ubuntu, install the appropriate JSON module for your PHP version:
Explanation:
Debian has removed the previous JSON extension from PHP 5.5rc2 due to a licensing conflict. A replacement extension has been provided.
Background:
The JSON license includes the phrase "The Software shall be used for Good, not Evil." This conflicts with the Free Software Foundation's definition of free software, which must be usable for any purpose.
Despite this, PHP itself has not removed JSON support. The issue is caused by distro packaging rather than PHP itself.
The above is the detailed content of Why is PHP throwing a \"Fatal error: Call to undefined function json_decode()\" in PHP 5.5.1-2 on Ubuntu?. For more information, please follow other related articles on the PHP Chinese website!