Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Ext-json is missing in composer.json [duplicate]

I cannot use json_encode() function in my Laravel project, it says ext-json is missing in composer.json. Any help please!

like image 371
mojahed Avatar asked May 31 '19 04:05

mojahed


1 Answers

For this problem, JetBrains PHP Storm blog provide a solution

"ext-json": "*"

It is important to list PHP extensions your project requires. Not all PHP installations are created equal: some may miss extensions you may consider as standard (such as ext-mysqliwhich is not installed by default in Fedora/CentOS minimal installation systems). Failure to list required PHP extensions may lead to a bad user experience: Composer will install your package without any errors but it will then fail at run-time. The show — platform command lists all PHP extensions available on your system. You may use it to help you compile the list of extensions you use and require. Alternatively you may use third party tools to analyze your project for the list of extensions used.

Read more here

like image 146
Muhammad Umair Ghufran Avatar answered Nov 18 '22 02:11

Muhammad Umair Ghufran