0

I am trying to create an API but running into the following error

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

Checking if OpenSSL and wrappers are enabled:

openssl: no
http wrapper: yes
https wrapper: no
wrappers: array(6) { [0]=> string(3) "php" [1]=> string(4) "file" [2]=> string(4) "glob" [3]=> string(4) "data" [4]=> string(4) "http" [5]=> string(3) "ftp" }

Tried everything I could find but nothing works.

PHP version: 5.6.1
OS: SLES 12

If you need more info please let me know.

In order to enable the php_openssl extension I did the following:

  • Installed php-openssl via YAST in SLES 12
  • added "extension=php_openssl.so" to the correct php.ini file
Cris Kolkman
  • 165
  • 2
  • 10
  • possible duplicate of [Unable to find the wrapper "https" - did you forget to enable it when you configured PHP?](http://stackoverflow.com/questions/5444249/unable-to-find-the-wrapper-https-did-you-forget-to-enable-it-when-you-config) – Kabb5 Jul 16 '15 at 12:05
  • @Kabb5 This is no duplicate, I have all the openssl enabled but server keeps returning that it's not enabled and keeps throwing that error message. – Cris Kolkman Jul 16 '15 at 12:15
  • 1
    If you have the openssl exension enable why does it say `openssl: no`? ;-) – VolkerK Jul 16 '15 at 12:20
  • @VolkerK That's my question indeed. – Cris Kolkman Jul 16 '15 at 12:27

2 Answers2

0

Looks like the php_openssl extension is either not present on your system or not loaded into he php core.

I'm not a SLES guy but there might be a php-openssl package which (if it exists) you should be able to install via

zypper install php-openssl

(maybe sudo zypper....)

The httpd has to be restarted if php is installed as an apache module.
After that you should check whether the php_openssl.so is loaded into the core. For that there should be a extension=php_openssl.so entry somewhere in one of the php.ini files (or is it just extension=openssl.so? Sorry, maybe someone else can fill in the specifics for SLES).
<?php phpinfo(); can tell you which ini file(s) has been used.
But there might be a tool for managing php extensions in an SLES installation. For Ubuntu you'd use php5enmod.

VolkerK
  • 95,432
  • 20
  • 163
  • 226
  • I tried everything so also this, I made sure the extension is installed and loaded in the correct php.ini. Thanks for your thoughts though. – Cris Kolkman Jul 16 '15 at 12:20
  • Does the openssl section show up in the output of ` – VolkerK Jul 16 '15 at 12:21
  • No that doesn't seem to show up. Server is saying openssl isn't installed but I did everything to enable openssl. – Cris Kolkman Jul 16 '15 at 12:26
  • "but I did everything to enable openssl" - no offense, but the outcome tells otherwise ;-) Therefore you should re-examine each single step and check the result. Please add to your question text how you made sure that a) openssl is present your system b) the php_openssl extension is present and c) it's laoded into the php core. It helps narrowing down the problem and will avoid generic answers like mine... – VolkerK Jul 16 '15 at 12:33
  • A) Installed php-openssl via YAST in SLES 12 B) added "extension=php_openssl.so" to the correct php.ini file C) That doesn't seem to happen – Cris Kolkman Jul 16 '15 at 12:38
  • How did you determine the `the correct php.ini `? And please add these information(s) to your original question text; not in another comment ;-) – VolkerK Jul 16 '15 at 12:40
  • Ah okay thanks. Because I edited the php.ini being mentioned in phpinfo(); It seems to be working now (didn't change anything), just have to test the connection to the outside world :) – Cris Kolkman Jul 16 '15 at 13:19
0

Re-installed OpenSSL and it's working now.

Cris Kolkman
  • 165
  • 2
  • 10