Search code examples
linuxlaravelcentoscomposer-phpphp-7

How to install json extension for PHP 7 on CentOS?


On my server I had PHP 5 installed previously .I upgraded it to PHP 7 by following the steps from here But when I try to install the composer for the using laravel ,it shows

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

Then I tried installing the json extension on the server ,it shows the following error

Error: php70u-cli conflicts with php-cli-5.5.38-8.el7.remi.x86_64
Error: php70u-common conflicts with php-common-5.5.38-8.el7.remi.x86_64

After hours of searching the internet, I couldn't still find any solution. Can somebody help me please ?


Solution

  • You can install JSON extension for PHP 7 in centos using below command.

    sudo yum install php70u-json