Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

vincej's avatar
Level 15

Error: JSON extension missing from PHP 7.2

I have installed Laravel 5.6 on Linux Mint 18, which essentially is Ubuntu 16.04LTS core, and when I go to a view, I get:

PHP's json extension is required to use Monolog's NormalizerFormatter

Ok - so I have added extension= json.so to my php.ini file and do an Apache restart. This does not help.

Ok, so I run sudo apt-get install php7.2-jsonand do an Apache restart. This does not help.

Ok, so I run phpenmod json and I get Module json ini file doesn't exist under /etc/php/7.2/mods-available.

Ok - so I check my phpinfo:

json support => enabled
json version => 1.6.0

So - you might imagine that I am absolutely flummoxed as to what might be going on. Any ideas?

Many Thanks !!

0 likes
10 replies
Dalma's avatar

Could your server have more than one php.ini file?

vincej's avatar
Level 15

Ummm .... maybe. I certainly have old versions of PHP installed. Should I delete those?? And then, is there a place in Apache.conf which stipulates which version to run??? I don't recall seeing a parameter like that. But then, my wife says I'm blind :o)

vincej's avatar
Level 15

In the end I deleted every single php install I had and reinstalled php7.2 with all the extension. It worked. Thanks

1 like
rgervace's avatar

am going through the same problem,am running on windows 7, have tried to exhaust all the work arounds and nothing seem to work. anybody around with a solution for windows for same above said eror? regards

smitpatelx's avatar

Guys I tried all of this and now I have this new error.

PHP's json extension is required to use Monolog's NormalizerFormatter

I dont know what't wrong, this is the first time I am using nginx, it works perfectly ok on apache (But not on current server) .

When I run php -m, it shows json

Snapey's avatar

@smitpatelx your web browser is probably using a different install of php compared to your command line.

write a route that just returns phpinfo and call it from ypur browser

smitpatelx's avatar

@SNAPEY - What you mean by web browser. It's not working on any web browser, and btw I deployed this project on ubuntu server.

Please or to participate in this conversation.