3

I know this question has been answered in other threads, but having the same problem and not finding the solution for my case in the given answers, I found a different solution for my case and that took me a while to find out, and since I can't reply to those other questions because I have only 1 reputation point, I post it as a new question.

The problem in my case was, that the "extension_dir" setting in my php.ini was wrong, because originally I had installed PHP in a different directory and then moved it manually.

So, if you checked your php.ini and found openssl enabled and still got that error, you may want to also check extension_dir in php.ini, if it points to where you expect it, and if the directory actually contains the openssl module.

Oliver Konig
  • 1,035
  • 2
  • 14
  • 17
  • To make this an accepted self answer you will need to post the answer below and accept it yourself (after 24hrs). When initially posting there is also an option to do this immediately. You might want to reconsider following that protocol. – SamV Nov 08 '13 at 12:49
  • Well, effectively destroying the PHP installation by moving it around, and subsequently destroying PHP's ability to use SSL, is hardly something related to Composer. – Sven Nov 08 '13 at 16:58
  • Not a question. It's also about how to install software which is borderline for StackOverflow anyway. – Danack Nov 08 '13 at 17:24
  • Yes, accepted, unfortunately I can't answer my question myself right now (because I don't have enough reputation points), have to wait until 8 hours after posting the question. No, I don't find this borderline, it's a solution to a problem that I had, and I couldn't find a hint at stackoverflow, and it took me quite some time to solve, and I thought that maybe others could run into the same trap and then benefit from my hint. – Oliver Konig Nov 08 '13 at 18:38
  • It is related to Composer because the problem was initially Composer's error message und inability to download PHP packages. Only the solution is not composer related. But then, if you look at the already existing and accepted answers to the same question, they mostly hint at looking at which php.ini file is actually effective, and that's not related to Composer, either. – Oliver Konig Nov 08 '13 at 18:47
  • Possible duplicate of [You must enable the openssl extension to download files via https](http://stackoverflow.com/questions/14291151/you-must-enable-the-openssl-extension-to-download-files-via-https) – jww Jun 19 '15 at 02:06

2 Answers2

1

check extension_dir in php.ini, can become incorrect after moving a PHP installation to a different folder.

Oliver Konig
  • 1,035
  • 2
  • 14
  • 17
0

Did you installed your php from source? If so, did you configured it with

./configure --with-config-file-path=/etc/php5/cli --with-openssl

Note about --with-openssl

Once done, it should work.

PS: Do not forget to make && make install

Milos Cuculovic
  • 19,631
  • 51
  • 159
  • 265