https does not work with CLI
Posted by: goldwinger (---.lightspeed.hstntx.sbcglobal.net)
Date: October 31, 2013 10:47PM

I am trying to install a dependency management tool called composer(getcomposer.org). The installation requires me to run a CLI script to download files using HTTPS. The command line text is:
php -r "eval('?>'.file_get_contents('https://getcomposer.org/installer'))

When I run this I get the follow message:
Unable to find wrapper - "https" - did you forget to enable it?

I have enable php_openssl and also the sslmodule in apache, but I still get the same error.

Options: ReplyQuote
Re: https does not work with CLI
Posted by: RiggsFolly (---.ppp.as43234.net)
Date: November 01, 2013 12:40AM

You need to set this option in the php.ini file

allow_url_fopen = On

Remember to edit the php.ini file that the CLI uses, which is the php.ini in c:\wamp\bin\php\php5.x.y\php.ini

The version that is edited by using the wampmanager -> PHP -> php.ini will not edit the correct file that is used by the CLI

Options: ReplyQuote
Re: https does not work with CLI
Posted by: stevenmartin99 (Moderator)
Date: November 01, 2013 07:23AM

Just go to the Url in your browser , download the file

Then point the get contents to the local copy!

Steven Martin
stevenmartin99@gmail.com
stevenmartin99@hotmail.com
PampServer.com - [pampserver.com]

Options: ReplyQuote
Re: https does not work with CLI
Posted by: goldwinger (---.lightspeed.hstntx.sbcglobal.net)
Date: November 01, 2013 01:16PM

Dearest Riggs,

Once again, your knowledge has saved me much time and effort.

It is the un-documented or a comment in passing regarding the bits of information to get a technology to work that cost so much time. I had no idea that there were multiple php.ini files. The php_openssl was not set in the CLI php.ini.

It would be nice if WAMP would include php.ini(CLI) in the pop up menu system.

The allow_url_fileopen was the other piece of the puzzle I needed.

Thank you.

I had worked around the initial file download, but Composer uses a compiled script that downloads dozens of other files using https protocol. So using my browser was not an option.

Options: ReplyQuote
Re: https does not work with CLI
Posted by: RiggsFolly (---.ppp.as43234.net)
Date: November 01, 2013 01:53PM

Great,

But, this is standard PHP functionality.

There is no point in WAMP documenting how PHP works when PHP already do that job.

[php.net]

Options: ReplyQuote


Sorry, only registered users may post in this forum.