4

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.

2 Answers 2

7

The JSON module for PHP is missing, try this:

apt-get install php5-json
Sign up to request clarification or add additional context in comments.

2 Comments

@LeifNeland are having the exact same error? If not, can you provide more information about you're problem?
For some reason which currently eludes me, composer was an alias to "php -n composer.phar". Removing -n allowed the install to proceed.
2

PHP extension are loading from two files

  1. /etc/php5/apache2/php.ini, which is used by Apache. enabled modules can be verified by creating a php file with phpinfo();. check json is present in the list. If not, install json using "sudo apt-get install php5-json" command and then restart apache.

  2. /etc/php5/cli/php.ini used by PHP while running from command line. enabled modules can be verified by "php -m" command without quotes. In my case json is not present in that list. enabling json module in php.ini file by adding "extension=json.so" to php.ini file solved the issue.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.