composer.json

Hi Guys,
Since I installed IJ Ultimate 2018.2 I am getting this warning: ext-PDO is missing in composer.json
In IJ Ultimate 2017.3.5 everything worked just fine!
I don't know how to deal with this.
Anybody can help? Please.


2
7 comments
Avatar
Permanently deleted user

Hello,

PHP plugin tries to sync all extensions with your composer.json.

You can disable this inspection in Settings | Editor | Inspections > PHP | Composer | Extension is missing in composer.json or add extension into composer.json under "require" key as explained here: https://getcomposer.org/doc/01-basic-usage.md#package-names .

Note that there's also https://youtrack.jetbrains.com/issue/WI-42968 issue with case sensitivity - it will be fixed in the next minor update.

6

Thank you Vladimir,
I just fixed my problem.
I am curious to learn more about composer.json, but I am too old for that.

 

1
Avatar
Permanently deleted user

'Composer' is an easy way to add and manage libraries without having to download them, extract them, save them and 'require' them - composer.json is where it keeps which libraries you want and which versions. It also makes it easy to upgrade those libraries. I'd recommend checking it out, it will change your life :)

0

Hi. I need to come back to this. As I am facing that issue since the update to PHPStorm 2020.3.2.
I didn't get that notification ('ext-pdo' is missing in composer.json) before. And I can see the PHP Runtime with PDO in the "External Libraries". So I wonder why I need the composer.json to be updated. 
I am new with composer but as I have ssen when adding the 'ext-pdo' to the composer.json and do an composer update it will probably download the appropriate files to my vendor folder. But why? I don't really need that files, as my code is working without that. So what is the advantage to have the conmposer.json updated then? Or why it is complaining at all?

Many thanks for your help!

0

The web server where you're deploying your app to might not have PDO extension enabled, that's why we're reporting it.

Adding the ext-* extensions to a require section of composer.json won't install them, but just run validity checks against them. The same applies to adding "php" to require section - that wouldn't download PHP executable files. Wish it was clearly stated in composer docs: https://getcomposer.org/doc/01-basic-usage.md#platform-packages

This is somewhat described in other sources e.g. http://syrwebdev.com/composer/2015/01/07/using-composer-to-require-php-modules.html

0

Hi Dimitry

Thank you very much for your detailed explaination!
I think I got it now.

Take care!

Cheers.

 

0

You're always welcome!

0

Please sign in to leave a comment.