TECH / Servers & Websites 2 min read

Unable to Find the Wrapper “https” in PHP: How to Enable OpenSSL

Antonio NEMCD Author
Published Jan 17, 2014 · 2 min

While setting up social login, payment webhooks, or a plain file_get_contents('https://...') call, PHP can throw a verbose warning: Unable to find the wrapper "https" – did you forget to enable it when you configured PHP?.

PHP logo

I first ran into this on a clean VPS running LiveStreet CMS, and the root cause was straightforward: PHP’s OpenSSL extension wasn’t enabled.

Step 1. Check Available Stream Wrappers and OpenSSL

Two quick commands show whether PHP currently supports HTTPS streams:

php -m | grep -i openssl
php -r "print_r(stream_get_wrappers());"

If http appears in stream_get_wrappers() while https is missing, the OpenSSL module isn’t loaded. While checking php.ini, also make sure allow_url_fopen = On is set, otherwise URL streams won’t open via file_get_contents() at all.

Step 2. Enable OpenSSL on Your Platform

  • Windows (XAMPP / Laragon / standalone PHP): find your active config via php --ini, open php.ini, uncomment extension=openssl (remove the leading ;), and verify that extension_dir = "ext" is also uncommented.
  • FreeBSD: install the OpenSSL extension matching your PHP branch (today via pkg instead of compiling from ports):
pkg install php83-openssl
service php-fpm restart
  • Linux (Debian / Ubuntu / RHEL): distro PHP builds include OpenSSL out of the box, so this error mainly occurs when compiling PHP from source without --with-openssl (requires libssl-dev / openssl-devel) or when allow_url_fopen is disabled.

Restart PHP-FPM or Apache after saving your changes and re-run stream_get_wrappers() to confirm https is listed. On managed shared hosting, OpenSSL is enabled almost everywhere by default – if it ever goes missing there, enable openssl in your panel or drop a quick note to support.

Related posts:

Leave a Comment