Home > database >  how to enable PHP openssl extension for php 8.1.8
how to enable PHP openssl extension for php 8.1.8

Time:08-10

I am trying to install a package into my symfony 6.1 application, and when i run the command composer require sensio/framework-extra-bundle

I get this error message 
[RuntimeException] You must enable the openssl extension in your php.ini
to load information from https://... 

I tried to enable the openssl extension at the php.ini file but i cant find the (extension=php_openssl.dll) line, i only find this (extension=openssl) and it's alredy uncommented.


For the php version it's PHP 8.1.8

(ask me for any additionnal informations)


If someone could help me to find a solution and thank you very much for your time :)

CodePudding user response:

On Windows (because of .dll)?

try full path to the php ext folder instead of only extension=openssl (without extension)

e.g.:

extension=C:\Dev\php-8.1.8\ext\php_openssl

CodePudding user response:

Debug if openssl is loaded in PHP

The symfony profile phpinfo, where you should be able to see, if your PHP configuration really runs openssl

try the following url

http://{local server address, e.g. localhost:8001}/_profiler/phpinfo where you may change the beginning of the link to your environment

outside symfony you may create an empty file e.g. phpinfo.php with the content

<?php
phpinfo();

Fixing the issue

your post lacks of information on your environment. How did you setup your developement environement.

As offtopic suggestion and to avoid this issue in the future you may have a look at docker, there you can setup a standardized environement, e.g. https://github.com/ger86/symfony-docker

  • Related