-
-
Notifications
You must be signed in to change notification settings - Fork 109
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
[Possible Fix] OpenSSL error: Can't install PHP 7.*, 5.* #131
Comments
Nice tips worked like a charm, thanks. I made some changes because I rather keep all the installs from asdf inside the asdf directory, but they are completely optional, more like a personal taste. FirstlyI would change the openssl installation directory, since putting all the installation in a "/bin" suffix quite doesn't make sense, for me at least. So:
SecondlyInstead of removing the "install_composer" line I would just comment it and add a new line with:
Last but not leastThen I can take the destination from the last echo command and use it to install composer in the related php directory. Oh and don't forget to change to the php version you've just installed (Added the command below as well)
|
the problem with composer can be solved by changing the php copy by curl in the install file, look for the install_composer method and replace the line |
@DiegoSilva94 Thank you for your tip ! It helped me 👍
You should do :
For a better explanation : https://stackoverflow.com/a/44698089 |
This is actually a build dependency issue and not necessarily the responsibility of someone working on this plugin to fix. It would probably be a good idea to have a discussion on this to determine to what extend this plugin is responsible for installing build dependencies. Especially in these scenario's where operating systems decide to no longer serve these packages from their repositories. |
Worked like a charm for me on arch linux! Thanks so much!!!!!!!!!! |
Have same problem in arch, fix more easy pacman -S openssl-1.1
export PKG_CONFIG_PATH=/usr/lib/openssl-1.1/pkgconfig Install success(with composer) |
Ubuntu 22.04 needed the package: |
Hi Arch Linux bros, I encountered numerous problems trying to install PHP 7 with asdf. Switching to openssl-1.1 solved a specific error, but then I encountered C compilation errors during the installation. I resolved these by installing some missing libraries: |
Also here, problems on Arch Linux with php 7.4 ✋
Still (different) problems also installiing suggested packages, pointing old openssl pgkconfig and installing it again:
Any ideas ? 😢 |
i had same issue like @danielemegna above, any update? |
test using a slightly older version of libxml2, 2.12 or even 2.9 |
Not from me. After many tries (lost in C compilation errors) I fell back to docker containers + remote interpreter configuration on IDE (devcontainsers or phpstorm remote docker interpreter). |
For me this worked well
Make sure to update the Edit using Make sure to install required homebrew packages. You can check them here in other issue #65 (comment). I have to install extra brew package You can find the homebrew package list from here also: https://github.com/asdf-community/asdf-php/blob/master/.github/workflows/workflow.yml#L52 Install PHP with some configure options. Not sure why this is the case but I needed postgresql, so I have to add these extra options for pgsql, libiconv and openssl
|
I need a PHP 7.4, and that is useful for me:
Then you will end up with PHP version 7.4.33, but there are some issues with composer.
That's all! |
Summary
It seems that many people are struggling to install older versions of PHP since OpenSSL is now on version 3. And so was I. After some digging I found this (possible) fix to issues like #129, #127, #125 and so on.
This same issue also happens with PHPBrew, and they have a fix for it, as you can see here. To adapt this fix for asdf is not really that hard. The fix involves compiling OpenSSL 1.1 (for php 7.4) from source and then using this locally compiled OpenSSL to execute the asdf php installation.
Fix
First
you should download and compile the OpenSSL's source. For php 7 this should be exactly the same as described in the phpbrew issue, where this fix is from (see below).
However, if I'm not wrong, there are at least some version of php 5 that require openssl 1.0.2 to compile properly. In OpenSSL website you can see that versions below and including 1.0.2 are out of support and their usage is discouraged. Nevertheless, you can still get them from here .
Next
you use the fresh compiled openssl to compile php with asdf
export PKG_CONFIG_PATH=$HOME/openssl-1.1.1i/bin/lib/pkgconfig && asdf install php 7.4.30
After that
you may or may not have another error when installing composer. It look something like:
There is a fix that involves downloading and applying some certificate. Though it didn't work for me, it might work for you:
Download certificate
Modify php.ini
What worked for me:
I went into
~/.asdf/plugins/php/bin
and removed the last line ininstall
:install_composer "$ASDF_INSTALL_PATH"
Then, after the installation with
export PKG_CONFIG_PATH=$HOME/openssl-1.1.1i/bin/lib/pkgconfig && asdf install php 7.4.30
I manually installed composer globally withIn the end
I hope that this can help you to get asdf-php back to its normal functioning.
The text was updated successfully, but these errors were encountered: