asdf-community/asdf-php

OpenSSL 3 on Ubuntu 22.04

justLuiz opened this issue · 4 comments

I'm trying to install but I'm having problems with openssl.
Any suggestions?

lsb_release -a

No LSB modules are available.
Distributor ID:	Ubuntu
Description:	Ubuntu 22.04 LTS
Release:	22.04
Codename:	jammy

uname -a

Linux xx 5.15.0-39-generic #42-Ubuntu SMP Thu Jun 9 23:42:32 UTC 2022 x86_64 x86_64 x86_64 GNU/Linux

openssl version

OpenSSL 3.0.2 15 Mar 2022 (Library: OpenSSL 3.0.2 15 Mar 2022)

asdf install php 8.1.7

checking for OpenSSL support... yes
checking for Kerberos support... no
checking whether to use system default cipher list instead of hardcoded value... no
checking for openssl >= 1.0.2... no
configure: error: Package requirements (openssl >= 1.0.2) were not met:

No package 'openssl' found

Consider adjusting the PKG_CONFIG_PATH environment variable if you
installed software in a non-standard prefix.

Alternatively, you may set the environment variables OPENSSL_CFLAGS
and OPENSSL_LIBS to avoid the need to call pkg-config.
See the pkg-config man page for more details.

I have the same release as @justLuiz and I get (installing any version of PHP)
Package 'libwebp', required by 'gdlib', not found

When installing any PHP version below 8.1 you will run into this issue. If you need to build older versions you will have to pull in an older version of OpenSSL. Doing so on Ubuntu will require you to download and build from source as Ubuntu no longer provides this package via aptitude.

See https://www.php.net/manual/en/openssl.requirements.php for more information. This is not an issue with asdf-php but a build dependencies issue which is something you are responsible for yourselves at this time of writing.

You can use this to fix the error
phpbrew/phpbrew#1263 (comment)

Then run
export PKG_CONFIG_PATH=PATH_TO_OPEN_SSL/bin/lib/pkgconfig && asdf install php PHP_VERSION

As @99linesofcode said, it's a dependency with an older version of OpenSSL, I was facing this issue when I was trying to install the 8.0.30 PHP version. This is how I got around with this issue:

  1. First you need to build the OpenSSL 1, if you are using Arch Linux, you can install it with the command pacman -S openssl-1.1
  2. After that you will need to locate the directory of the OpenSSL 1, in my case it was in /usr/lib/openssl-1.1/ and get the full path with the pkgconfig folder inside.
  3. Finally, you need to export the PKG_CONFIG_PATH variable with the full OpenSSL 1 path and the pkgconfig folder, in my case the command was export PKG_CONFIG_PATH=/usr/lib/openssl-1.1/pkgconfig

And then I was able to install the 8.0.30 version.