By ChapDaddy65
I have a LEMP stack running and I’m working on installing Laravel when I’ve ran into a snag trying to install Composer.
I execute this: curl -sS https://getcomposer.org/installer | php
and I get this:
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 recently upgraded PHP to v7.0.14 and didn’t know that JSON wasn’t installed and/or configured, so I attempted to install the extension via pecl, but is apparently deprecated for PHP v7 in favor of "channel://http://www.php.net/json/json".
I’m not use to running CentOS so I’m not sure how to tackle this. how do I install the JSON extension to allow Composer to install?
I realized I followed this guide: DO: Upgrade php7 on centos 7
and I found a json package that worked from the IUS Repository where I got my PHP7 install.
this solved it: sudo yum install php70u-json
This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
Glad you’ve got it solved. The PHP versions that ship with most Linux distributions can be pretty light on extensions/modules by default but there are many pre-built ones available in the distro’s repository that can be installed by yum, dnf or apt.
For example, on Ubuntu 16.04 this issue would be solved with:
apt-get update;
apt-get install php7.0-json;
Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.
Full documentation for every DigitalOcean product.
The Wave has everything you need to know about building a business, from raising funding to marketing your product.
Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.
New accounts only. By submitting your email you agree to our Privacy Policy
Scale up as you grow — whether you're running one virtual machine or ten thousand.
Sign up and get $200 in credit for your first 60 days with DigitalOcean.*
*This promotional offer applies to new accounts only.