If you have this error message that means your openssl extention is not enabled or misconfigured (in php.ini)

first thing to do is to check if the extenstion is installed :

>php -m

with this command we can see all enabled modules (&extensions) if you dont find openssl in the list

in this case go to php folder (for me under C:\wamp64\bin\php\php8.2.1) and activate open ssl by removing the semicolon

;...
;extension=odbc
extension=openssl
;extension=pdo_firebird
;...

save and now try to see with php -m if you dont see openssl module and you have this error :

PHP Warning: PHP Startup: Unable to load dynamic library 'C:\php\php_openssl.dll' - The specified module could not be found

or this one

Warning: PHP Startup: Unable to load dynamic library 'openssl' (tried: C:\php\ext\openssl (Le module spécifié est introuvable), C:\php\ext\php_openssl.dll (Le module spécifié est introuvable)) in Unknown on line 0

return to php.ini and anctivate this param like this:

; On windows:
extension_dir = "ext"
; On Linux/OSx
extension_dir = "./"

now retry with php -m and you should see openssl activated.

if it’s not the case and you still have the problem, that means you have not the executable in the /ext under php folder so you should install openssl manualy from this url https://www.php.net/manual/en/openssl.installation.php

  • if you can’t resolve and you are pressed to use composer so you can disable tls from the process (only for dev so it’s not recommended because it is not secure for your env)
composer config -g -- disable-tls true

hope i helped

thank you

Aller au contenu principal