No https wrapper gets loaded

Forum for you who has PHP installation issues

Moderators: gesf, Michalio

Post Reply
DVS75
New php-forum User
New php-forum User
Posts: 1
Joined: Sun Aug 07, 2022 12:55 am

When I use file_get_contents() to open an https webpage (into a string) I get an error message:

Warning: file_get_contents(): Unable to find the wrapper "https" - did you forget to enable it when you configured PHP? in …

My Apache and PHP versions: Apache/2.4.54 (Win64) OpenSSL/1.1.1p PHP/8.1.9. Windows 11

I have uncommented in php.ini:
extension_dir = "ext"
extension=openssl
Checked this several times and restarted the server several times.

I have searched and there is only php.ini on the disk.

phpinfo() regarding https:
HTTPS on
SSL_TLS_SNI localhost
SSL_SERVER_S_DN_O TESTING CERTIFICATE
SSL_SERVER_S_DN_OU NOT FOR TRUST PURPOSES
SSL_SERVER_S_DN_CN localhost
SSL_SERVER_I_DN_O TESTING CERTIFICATE
SSL_SERVER_I_DN_OU NOT FOR TRUST PURPOSES
SSL_SERVER_I_DN_CN localhost
SSL_SERVER_SAN_DNS_0 localhost
SSL_VERSION_INTERFACE mod_ssl/2.4.54
SSL_VERSION_LIBRARY OpenSSL/1.1.1p
SSL_PROTOCOL TLSv1.3
SSL_SECURE_RENEG false
SSL_COMPRESS_METHOD NULL
SSL_CIPHER TLS_CHACHA20_POLY1305_SHA256
SSL_CIPHER_EXPORT false
SSL_CIPHER_USEKEYSIZE 256
SSL_CIPHER_ALGKEYSIZE 256
SSL_CLIENT_VERIFY NONE
SSL_SERVER_M_VERSION 3
SSL_SERVER_M_SERIAL 2C2DD15BD9E5F8417470880FA0423E3F6F3314BD
SSL_SERVER_V_START Jun 24 01:07:25 2022 GMT
SSL_SERVER_V_END Dec 24 01:07:25 2022 GMT
SSL_SERVER_S_DN CN=localhost,OU=NOT FOR TRUST PURPOSES,O=TESTING CERTIFICATE
SSL_SERVER_I_DN CN=localhost,OU=NOT FOR TRUST PURPOSES,O=TESTING CERTIFICATE
SSL_SERVER_A_KEY rsaEncryption
SSL_SERVER_A_SIG sha256WithRSAEncryption
SSL_SESSION_ID 2bfa35977e2164cf63c8c6bd05feb759ff9fbde7a88303d2c4550e066222d629
SSL_SESSION_RESUMED Initial
However, stream_get_wrappers() says that:
openssl: no
http wrapper: yes
https wrapper: no
Please help make https working.

Thank you!
User avatar
Michalio
Moderator
Moderator
Posts: 265
Joined: Sun Jul 18, 2021 1:33 pm
Location: Poland

What the error log said? Maybe the openssl extension file not exists or have different name so it can not be loaded
Free coding lessons: https://php-forum.com/phpforum/viewtopic.php?t=29852
Post Reply