PHP with Composer and PHPstorm, extensions not seen

86 Views Asked by At

I'll try and outline all the details here.

Technologies used

  • Scoop for different PHP versions
  • PhpStorm IDE
  • Composer
  • Windows system

Issue

Currently, when I run the php --ini command I get warnings like

PHP Warning: PHP Startup: Unable to load dynamic library 'curl' (tried: [USER PATH]\scoop\apps\php\current\ext\curl (The specified module could not be found), [USER PATH]\scoop\apps\php\current\ext\php_curl.dll (The specified module could not be found)) in Unknown on line 0

I have removed the ; symbol from all the extensions I'm getting this error from. In addition, I have gone to the second file path to verify that the DLL files are also there which they are. I have also updated my php.ini file to also set the folder path for the ext folder which by that warning it is attempting to look into it to find the extensions.

In addition to the warnings above there is this also.

Configuration File (php.ini) Path:
Loaded Configuration File:         [USER PATH]\scoop\apps\php8.2\current\php.ini
Scan for additional .ini files in: [USER PATH]\scoop\apps\php\current\cli;[USER PATH]\ken.echard\scoop\apps\php\current\cli\conf.d;
Additional .ini files parsed:      [USER PATH]\scoop\apps\php\current\cli\php.ini

I have reviewed a number of sources and tried switching the file path. I know that it does see the ini file because when I uncomment another extension another warning shows up. This leads me to the only thing left being something wrong with the extensions or some communication between them. So I started trying to replace the DLL files but that didn't do anything at all.

What I do not understand is that Composer seems to be reactive to the php.ini file I'm updating but doesn't see the extension folder.

Can anyone offer up any help to explain what could be wrong or what is going on here?

I noted a bunch in text above but will list again what I have tried.

  • Changed PHP versions (it does seem to detect this when running php --ini)
  • Made sure that the extensions in php.ini file are uncommented (this proved that it is reading the .ini file because when I uncommented more more warnings showed up)
  • updated the extension path to be the whole file path to the ext folder that we want it to look at in addition to uncommenting it.
1

There are 1 best solutions below

1
On

if you have multiple php versions exp: 7.4, 8.0 and 8.1 composer can support one version at the time. you need composer to other php version, again install in php version directory