install php failing on ubuntu jelly
NigelThorne opened this issue · 2 comments
I checked the build script and ran
sudo apt-get update && sudo apt-get install -y autoconf bison build-essential curl gettext git libgd-dev libcurl4-openssl-dev libedit-dev libicu-dev libjpeg-dev libmysqlclient-dev libonig-dev libpng-dev libpq-dev libreadline-dev libsqlite3-dev libssl-dev libxml2-dev libzip-dev openssl pkg-config re2c zlib1g-dev
then
asdf install php 8.0.10
I get
/bin/bash /tmp/tmp.94nY465wXz/php-src-php-8.0.10/libtool --silent --preserve-dup-deps --mode=compile cc -Iext/pcre/ -I/tmp/tmp.94nY465wXz/php-src-php-8.0.10/ext/pcre/ -I/tmp/tmp.94nY465wXz/php-src-php-8.0.10/include -I/tmp/tmp.94nY465wXz/php-src-php-8.0.10/main -I/tmp/tmp.94nY465wXz/php-src-php-8.0.10 -I/tmp/tmp.94nY465wXz/php-src-php-8.0.10/ext/date/lib -I/usr/include/libxml2 -I/usr/include/x86_64-linux-gnu -I/tmp/tmp.94nY465wXz/php-src-php-8.0.10/ext/mbstring/libmbfl -I/tmp/tmp.94nY465wXz/php-src-php-8.0.10/ext/mbstring/libmbfl/mbfl -I/usr/include/postgresql -I/tmp/tmp.94nY465wXz/php-src-php-8.0.10/TSRM -I/tmp/tmp.94nY465wXz/php-src-php-8.0.10/Zend -Wno-clobbered -Wall -Wextra -Wno-strict-aliasing -Wno-implicit-fallthrough -Wno-unused-parameter -Wno-sign-compare -g -O2 -fvisibility=hidden -DZEND_SIGNALS -mshstk -DHAVE_CONFIG_H -I/tmp/tmp.94nY465wXz/php-src-php-8.0.10/ext/pcre/pcre2lib -DZEND_ENABLE_STATIC_TSRMLS_CACHE=1 -c /tmp/tmp.94nY465wXz/php-src-php-8.0.10/ext/pcre/pcre2lib/pcre2_auto_possess.c -o ext/pcre/pcre2lib/pcre2_auto_possess.lo
In file included from /tmp/tmp.94nY465wXz/php-src-php-8.0.10/main/php.h:439,
from /tmp/tmp.94nY465wXz/php-src-php-8.0.10/ext/openssl/openssl.c:27:
/tmp/tmp.94nY465wXz/php-src-php-8.0.10/ext/openssl/openssl.c: In function ‘zm_startup_openssl’:
/tmp/tmp.94nY465wXz/php-src-php-8.0.10/ext/openssl/openssl.c:1224:58: error: ‘RSA_SSLV23_PADDING’ undeclared (first use in this function); did you mean ‘RSA_PKCS1_PADDING’?
1224 | REGISTER_LONG_CONSTANT("OPENSSL_SSLV23_PADDING", RSA_SSLV23_PADDING, CONST_CS|CONST_PERSISTENT);
an error with RSA_SSLV23_PADDING
not being defined.
I got the same for 8.0.11.
Any ideas?
I have the same issue with 7.4:
asdf isntall php 7.4.29
When searching around I found it is something to do with openssl 3.0 which is supported in php 8.1 but not in lower version. https://bugs.php.net/bug.php?id=81278
I have the same issue with 7.4:
asdf isntall php 7.4.29
When searching around I found it is something to do with openssl 3.0 which is supported in php 8.1 but not in lower version. https://bugs.php.net/bug.php?id=81278
For PHP 5.6 it seems that the libssl1.1.0 is the one supported (maybe lower), but for PHP 7.x you can just follow the steps below. This is the same fix when you try to install the sqlsrv (pdo) driver, the driver/extension seems to install ok but when you try to connect to the server... bam! Error 0x2746!
First of all remove the current libssl packages you have installed and then follow the installation below
WGET files
wget http://security.ubuntu.com/ubuntu/pool/main/o/openssl/openssl_1.1.1-1ubuntu2.1~18.04.18_amd64.deb
wget http://security.ubuntu.com/ubuntu/pool/main/o/openssl/libssl1.1_1.1.1-1ubuntu2.1~18.04.18_amd64.deb
wget http://security.ubuntu.com/ubuntu/pool/main/o/openssl/libssl-dev_1.1.1-1ubuntu2.1~18.04.18_amd64.deb
Note: They are still updating with security fixes the 1.1.1 version if the minor (major.feature.minor) version change, just access this link and see what is the last one: http://security.ubuntu.com/ubuntu/pool/main/o/openssl/
Install old packages
$ sudo dpkg -i openssl_1.1.1-1ubuntu2.118.04.1_amd64.deb libssl1.1_1.1.1-1ubuntu2.118.04.1_amd64.deb libssl-dev_1.1.1-1ubuntu2.1~18.04.1_amd64.deb
After that, check installed version:
$ openssl version
OpenSSL 1.1.1 11 Sep 2018
This will prevent your update manager from automatically upgrading these packages again:
$ sudo apt-mark hold openssl libssl-dev libssl1.1:amd64
TL;DR
Of course if you have any application that actually need the Openssl 3.0 you'll need to unhold the packages install the updated libssl, use your app and then do the same with the older version of openssl if you want to use php with openssl again. Of source there should be a way of fixing it just linking to a specific folder where you can place all the older files yada yada but I really don't use older versions with PHP that much, and all in all we have docker :)