Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can't install composer - the json extension is missing

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.

like image 469
Nikos Grigoriadis Avatar asked Oct 24 '13 23:10

Nikos Grigoriadis


People also ask

How do I fix the Composer installer error?

Make sure you have no problems with your setup by running the installer's checks via curl -sS https://getcomposer.org/installer | php -- --check . Try clearing Composer's cache by running composer clear-cache . Ensure you're installing vendors straight from your composer.

Where is my Composer JSON file?

composer. json is a JSON file placed in the root folder of PHP project. Its purpose is to specify a common project properties, meta data and dependencies, and it is a part of vast array of existing projects.

Where is Composer json in Linux?

Composer. json - this file is the configuration for your project. This is usually best located at the top level of your project. Ideally this is a directory outside the scope of your web server - so that it will never be exposed or served.

How do I run a Composer JSON file?

To configure Composer for your PHP app json file specifies required packages. Verify that a composer. json file is present in the root of your git repository. Run composer install (on your local machine) to install the required packages and generate a composer.


1 Answers

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.

like image 115
Rufinus Avatar answered Oct 04 '22 03:10

Rufinus