eddard.stark eddard.stark - 1 year ago 365
JSON Question

How to resolve Call to undefined function Composer\Json\json_decode()

I am in a linux mint system. I have install composer. I am trying to install laravel 4 in my www folder. I used this command "composer create-project laravel/laravel l4 --prefer-dist" at first they said I had to install mcrypt. I went to the php site and they said I need to install mcrypt using these commands.

apt-get install php5-mcrypt
mv -i /etc/php5/conf.d/mcrypt.ini /etc/php5/mods-available/
php5enmod mcrypt
service apache2 restart

I have done them. Now when I try to install laravel 4 they say

Fatal error: Call to undefined function Composer\Json\json_decode() in phar:///usr/local/bin/composer/src/Composer/Json/JsonFile.php on line 217

I don't know what to do now. Please help me. I am stuck for hours.

Answer Source

The JSON module for PHP is missing, try this:

apt-get install php5-json
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download