Can't install composer - the json extension is missing

26,312

just install the module:

sudo apt-get install php5-json

EDIT - Reason:

See Heanzo Beanzo Comment:

It has been removed in recent packages due to a license conflict see bug on php.net.

Share:
26,312
Nikos Grigoriadis
Author by

Nikos Grigoriadis

Web Developer | Digital Marketer Github : github.com/grrnikos

Updated on March 06, 2020

Comments

  • Nikos Grigoriadis
    Nikos Grigoriadis about 4 years

    I'm trying to install composer on my Ubuntu 13.10 machine 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
    

    php --version gives me PHP 5.5.3-1ubuntu2 (cli) so I think it should have the json extension installed.

  • Nikos Grigoriadis
    Nikos Grigoriadis over 10 years
    That works thanks. But isn't the json extension supposed to be bundled and compiled into PHP by default?
  • Rufinus
    Rufinus over 10 years
    the core of php is rather small, all is grouped in modules. if you compile from source, many of this modules (like json) are selected by default. but it seems the package maintainer want to give the user more control over what he wants to install. this is good in most cases.
  • Hannes Schneidermayer
    Hannes Schneidermayer over 10 years
    It has been removed in recent packages due to a license conflict (see bugs.php.net/bug.php?id=63520).
  • rickfoosusa
    rickfoosusa over 10 years
    If php-json were a dependency of php-common, everyone would have installed it while upgrading to 13.10..It wasted enough of my time to file a bug: bugs.launchpad.net/ubuntu/+source/ubiquity/+bug/1280030
  • Rufinus
    Rufinus about 10 years
    and the whole reason why.. cause he thinks he is funny... youtube.com/watch?v=-hCimLnIsDA
  • Syed Priom
    Syed Priom almost 9 years
    How do you verify it's installed or not?