So, I had this problem. I have Marc Liyanage's PHP 5.2.4 package installed on my MacBook Pro and use it for local dev tasks. It's supposed to have JSON installed, phpinfo says it has JSON installed, but when I ran a bit of code that used the json_decode() function, I got the "call to undefined function" error.

When I tried to find something online where someone had the same problem, a Google search requiring the error message as a phrase and the word "mac" turned up ONE result, and that was a guy mentioning the error in blog comments.

So, I never found out how to fix my install, but a quick kludge was found here in the second post. I put the JSON.php file from the downloaded .gz archive in the same folder as my PHP script, added the suggested code to JSON.php, and added "import('JSON.php')" to my script. Voila.

Now, the rare person with my issue will be able to search for the error message and "mac" and find, if not the answer, a workable kludge.

  • Share/Bookmark
Leave a Reply

XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>


Get an angel for your site An Angel Watches Over This Site