Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MacOS: Unable to find the wrapper "https" #163

Open
tylerlwsmith opened this issue Dec 23, 2023 · 7 comments
Open

MacOS: Unable to find the wrapper "https" #163

tylerlwsmith opened this issue Dec 23, 2023 · 7 comments

Comments

@tylerlwsmith
Copy link

tylerlwsmith commented Dec 23, 2023

Provide environment information

OS:
Darwin My-MacBook-Pro.local 23.1.0 Darwin Kernel Version 23.1.0: Mon Oct  9 21:33:00 PDT 2023; root:xnu-10002.41.9~7/RELEASE_ARM64_T6031 arm64

SHELL:
zsh 5.9 (x86_64-apple-darwin23.0)

BASH VERSION:
3.2.57(1)-release

ASDF VERSION:
v0.13.1-0586b37

ASDF INTERNAL VARIABLES:
ASDF_DEFAULT_TOOL_VERSIONS_FILENAME=.tool-versions
ASDF_DATA_DIR=/Users/tyler/.asdf
ASDF_DIR=/Users/tyler/.asdf
ASDF_CONFIG_FILE=/Users/tyler/.asdfrc

ASDF INSTALLED PLUGINS:
elixir                       https://github.com/asdf-vm/asdf-elixir.git master a4c42e1
erlang                       https://github.com/asdf-vm/asdf-erlang.git master aaa3ee7
nodejs                       https://github.com/asdf-vm/asdf-nodejs.git master c5b7c40
php                          https://github.com/asdf-community/asdf-php.git master 1eaf4de
ruby                         https://github.com/asdf-vm/asdf-ruby.git master b3d44de

To Reproduce

Run asdf install php 8.3.1 or PHP_WITHOUT_PEAR=yes asdf install php 8.3.1.

Describe the Bug

Installation appears to error out when trying to install pear or composer because https is not enabled in php.ini during the installation.

When running asdf install php 8.3.1, I get the following errors:

Warning: fopen(): Unable to find the wrapper "https" - did you forget to enable it when you configured PHP? in /private/var/folders/5_/jsnsc2s51wl08b_htp4xrctr0000gn/T/php-src-php-8.3.1/pear/fetch.php on line 66

Warning: fopen(https://pear.php.net/install-pear-nozlib.phar): Failed to open stream: No such file or directory in /private/var/folders/5_/jsnsc2s51wl08b_htp4xrctr0000gn/T/php-src-php-8.3.1/pear/fetch.php on line 66

Error..
fopen(https://pear.php.net/install-pear-nozlib.phar): Failed to open stream: No such file or directory
make: *** [install-pear] Error 1

When running PHP_WITHOUT_PEAR=yes asdf install php 8.3.1, I get the following errors:

Warning: copy(): Unable to find the wrapper "https" - did you forget to enable it when you configured PHP? in Command line code on line 1

Warning: copy(): Unable to find the wrapper "https" - did you forget to enable it when you configured PHP? in Command line code on line 1

Warning: copy(): Unable to find the wrapper "https" - did you forget to enable it when you configured PHP? in Command line code on line 1

Warning: copy(https://getcomposer.org/installer): Failed to open stream: No such file or directory in Command line code on line 1

Warning: hash_file(composer-setup.php): Failed to open stream: No such file or directory in Command line code on line 1
Installer corrupt
Warning: unlink(composer-setup.php): No such file or directory in Command line code on line 1

Could not open input file: composer-setup.php
tyler@My-MacBook-Pro installs %

Expected Behaviour

PHP successfully installs, or fails in a way that indicates a missing dependency before the installation fails on an https request.

@tylerlwsmith
Copy link
Author

tylerlwsmith commented Dec 23, 2023

I've been able to work around this issue in two ways:

  1. Install OpenSSL on my MacBook using brew install openssl@1.1
  2. Update both instances of homebrew_package_path openssl@1.1 to homebrew_package_path openssl in the install file.

@tylerlwsmith tylerlwsmith changed the title Unable to find the wrapper "https" MacOS: Unable to find the wrapper "https" Dec 24, 2023
@watsonarw
Copy link

@tylerlwsmith Thank you for the workaround! I was pulling my hair out wondering why it wasn't working on my newer machine, but was fine on an older one.

It seems like openssl@1.1 is an undocumented dependency on MacOS, it might be helpful if it were explicitly documented/installed in the Github actions workflow.

@yoonwaiyan
Copy link

I changed the install file to point to openssl without specifying version 1.1 and it worked.

@tangrufus
Copy link

tangrufus commented Feb 9, 2024

Continue @tylerlwsmith's awesome workaround but without editing files:

$ brew install openssl@1.1

### If you have openssl v3 installed (you most likely do)
$ brew unlink openssl@3
Unlinking /opt/homebrew/Cellar/openssl@3/3.2.1... 5867 symlinks removed.

$ brew link openssl@1.1
Linking /opt/homebrew/Cellar/openssl@1.1/1.1.1w... 3999 symlinks created.

If you need to have this software first in your PATH instead consider running:
  echo 'export PATH="/opt/homebrew/opt/openssl@1.1/bin:$PATH"' >> ~/.zshrc

$ openssl version
OpenSSL 1.1.1w  11 Sep 2023

$ asdf install php xxx

### Restore openssl version to v3
$ brew unlink openssl@1.1
Unlinking /opt/homebrew/Cellar/openssl@1.1/1.1.1w... 3999 symlinks removed.

$ brew link openssl@3
Linking /opt/homebrew/Cellar/openssl@3/3.2.1... 5867 symlinks created.

$ openssl version
OpenSSL 3.2.1 30 Jan 2024 (Library: OpenSSL 3.2.1 30 Jan 2024)

@tristanjahier
Copy link

Oddly enough, after installing OpenSSL 1.1 via Homebrew and installing PHP 8.3, I did not need to switch to OpenSSL 1.1 to install other versions of PHP. I even tried to re-install PHP 8.3 with OpenSSL 3 linked and it worked properly. The build output shows that it actually uses openssl@1.1. Maybe we just need to have openssl@1.1 installed?

@cameronmurphy
Copy link

OpenSSL 1.1 reached end of life on September 11, 2023, and as such I get this warning when installing openssl@1.1 from Homebrew:

Warning: openssl@1.1 has been deprecated because it is not supported upstream!

Probably naive question: PHP 8.1 added support for OpenSSL 3.0 - can compile against that instead?

@godbout
Copy link

godbout commented Apr 17, 2024

for those on macOS who want openssl 3 with PHP:

  • for PHP8.1+ edit the install file and replace openssl@1.1 by openssl@3
  • for PHP versions before 8.1, well, PHP only supports openssl@1.1 so you don't need to edit the install file, but you need to brew install openssl@1.1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

7 participants