I'm trying to install composer on my Ubuntu 12.04 LTS machine, for Magento2 installation but the following error occurs:

Some settings on your machine make Composer unable to work properly.
Make sure that you fix the issues listed below and run this script again:

The json extension is missing.
Install it or recompile php without --disable-json

I check that JSON is already installed through below command -

aptitude show php5-json

which shows below result -

Package: php5-json                
State: installed
Automatically installed: no
Version: 1.3.7-1+deb.sury.org~precise+1
Priority: optional
Section: php
Maintainer: Debian PHP PECL Maintainers <[email protected]>
Architecture: amd64
Uncompressed Size: 117 k
Depends: libc6 (>= 2.14), libjson-c2 (>= 0.11-3~), phpapi-20121212, ucf
Conflicts: php5-json
Breaks: php5-common (< 5.5.0~rc1+dfsg-1~), php5-common (< 5.5.0~rc1+dfsg-1~), php5-dev (< 5.5.0~rc1+dfsg-1~), php5-dev (< 5.5.0~rc1+dfsg-1~)
Replaces: php5-dev (< 5.5.0~rc1+dfsg-1~), php5-dev (< 5.5.0~rc1+dfsg-1~)
Provided by: php5-common
Description: JSON module for php5
 This package provides a module for JSON functions in PHP scripts. 

 PHP (recursive acronym for PHP: Hypertext Preprocessor) is a widely-used open source general-purpose scripting language that is especially
 suited for web development and can be embedded into HTML.

please help to overcome with this.


2 Answers 2


What is your php -m | grep json output? Do you have "json" as a result? If not then you need to enable this module in php.ini. A list of used php.ini files can be retrieved using php --ini.

  • php -m | grep json output is nothing, What I have to write in php.ini? Nov 18, 2015 at 10:17
  • 1
    Usually it is enough to run "sudo apt-get install php5-json" and it should get installed properly. You should find in your php.ini commented line "extension=json.so", if it is not present, then add it. Nov 18, 2015 at 10:23

Please make sure that the PHP extension not only installed but actually loaded by the PHP interpreter. You can see it by running the phpinfo function.

This site is temporarily in read-only mode and not accepting new answers.

Not the answer you're looking for? Browse other questions tagged .