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

Ubuntu 16.04 php 5.5.36 #939

Closed
sasha2002 opened this issue Dec 12, 2017 · 13 comments
Closed

Ubuntu 16.04 php 5.5.36 #939

sasha2002 opened this issue Dec 12, 2017 · 13 comments

Comments

@sasha2002
Copy link

Output

/root/.phpbrew/build/php-5.5.36/ext/openssl/openssl.c:4991:17: error: storage size of ‘cipher_ctx’ isn’t known

  EVP_CIPHER_CTX cipher_ctx;

                 ^

Makefile:524: recipe for target 'ext/openssl/openssl.lo' failed

make: *** [ext/openssl/openssl.lo] Error 1

Expected Result

To be installed

Command

Paste your phpbrew install command here (be sure to install with --debug flag, e.g. phpbrew --debug install)

phpbrew --debug install php-5.x.x +openssl -- --

Build Log

https://gist.github.com/sasha2002/6150eebe57a8c71c0bb39e772b06c130

Platform

OS:

Ubuntu 16.04

Running PHP:
5.6 5.7
Installing PHP:

5.5.36

@morozov
Copy link
Contributor

morozov commented Dec 12, 2017

@sasha2002 most likely your OpenSSL version is incompatible with PHP 5.5. Not sure what the requirements are. Could you post your output of apt-cache policy openssl?

I just was able to phpbrew install php-5.5.38 +openssl with the following:

openssl:
  Installed: 1.0.2g-1ubuntu4.9
  Candidate: 1.0.2g-1ubuntu4.10
  Version table:
     1.0.2g-1ubuntu4.10 500
        500 http://us.archive.ubuntu.com/ubuntu xenial-updates/main amd64 Packages
        500 http://security.ubuntu.com/ubuntu xenial-security/main amd64 Packages
 *** 1.0.2g-1ubuntu4.9 100
        100 /var/lib/dpkg/status
     1.0.2g-1ubuntu4 500
        500 http://us.archive.ubuntu.com/ubuntu xenial/main amd64 Packages

@sasha2002
Copy link
Author

sasha2002 commented Dec 12, 2017

Yeah, thanks for the hint.
Have installed PPA ondrej

# apt-cache policy openssl
openssl:
  Installed: 1.1.0g-2.1+ubuntu16.04.1+deb.sury.org+1
  Candidate: 1.1.0g-2.1+ubuntu16.04.1+deb.sury.org+1
  Version table:
 *** 1.1.0g-2.1+ubuntu16.04.1+deb.sury.org+1 500
        500 http://ppa.launchpad.net/ondrej/apache2/ubuntu xenial/main amd64 Packages
        100 /var/lib/dpkg/status
     1.1.0g-2.1+ubuntu16.04.1+deb.sury.org+1 500
        500 http://ppa.launchpad.net/ondrej/php/ubuntu xenial/main amd64 Packages
     1.0.2g-1ubuntu4.10 500
        500 http://de.archive.ubuntu.com/ubuntu xenial-updates/main amd64 Packages
        500 http://security.ubuntu.com/ubuntu xenial-security/main amd64 Packages
     1.0.2g-1ubuntu4.9 500
        500 http://mirror.hetzner.de/ubuntu/packages xenial-updates/main amd64 Packages
        500 http://mirror.hetzner.de/ubuntu/security xenial-security/main amd64 Packages
     1.0.2g-1ubuntu4 500
        500 http://mirror.hetzner.de/ubuntu/packages xenial/main amd64 Packages
        500 http://de.archive.ubuntu.com/ubuntu xenial/main amd64 Packages

@morozov
Copy link
Contributor

morozov commented Dec 14, 2017

@sasha2002 please see if downgrading OpenSSL solves the problem. There's nothing we can do about this on the PHPBrew end.

@varshith
Copy link

varshith commented Feb 20, 2018

This is indeed an issue with 5.* versions of PHP not compatible with openssl version.
Downgrading openssl to 1.0.2 (lts) and also downgrading libssl-dev version to 1.0.2 did it for me
something like
sudo apt-get install openssl=1.0.2*/
sudo apt-get install libssl-dev=1.0.2*/

@morozov morozov closed this as completed Feb 20, 2018
@zk94007
Copy link

zk94007 commented May 3, 2018

phpbrew install 5.6.36 +default
===> phpbrew will now build 5.6.36
===> Loading and resolving variants...
Checking distribution checksum...
Checksum matched: 626a0e3f5d8a0e686a2b930f0dd3a0601fe3dcb5e43dd0e8c3fab631e64e172a
===> Distribution file was successfully extracted, skipping...
Found existing Makefile, running make clean to ensure everything will be rebuilt.
You can append --no-clean option after the install command if you don't want to rebuild.
===> Running make clean: /usr/bin/make -C '/home/dalmi/.phpbrew/build/php-5.6.36' --quiet 'clean'
===> Checking patches...
Checking patch for replace apache php module name with custom version name
Found existing build.log, renaming it to /home/dalmi/.phpbrew/build/php-5.6.36/build.log.1525305792
===> Configuring 5.6.36...

Use tail command to see what's going on:
$ tail -F /home/dalmi/.phpbrew/build/php-5.6.36/build.log

===> Checking patches...
Checking patch for php5.3.29 multi-sapi patch.
Checking patch for php5.3.x on 64bit machine when intl is enabled.
Checking patch for openssl dso linking patch
===> Building...
Error: Make failed:
The last 5 lines in the log file:
/home/dalmi/.phpbrew/build/php-5.6.36/ext/openssl/openssl.c:5316:17: error: storage size of ‘cipher_ctx’ isn’t known

EVP_CIPHER_CTX cipher_ctx;

             ^

Makefile:526: recipe for target 'ext/openssl/openssl.lo' failed

make: *** [ext/openssl/openssl.lo] Error 1

Please checkout the build log file for more details:
tail /home/dalmi/.phpbrew/build/php-5.6.36/build.log

@nelson6e65
Copy link

nelson6e65 commented Jul 6, 2018

So... phpbrew is not compatible with php 5.5 and 5.6 +php7?

I'm on Fedora 28 with PHP 7.2 installed by system.

@morozov
Copy link
Contributor

morozov commented Jul 6, 2018

@nelson6e65 PHPBrew can build all PHP versions starting 5.3. Not all OpenSSL versions are compatible with all PHP versions.

@dciancu
Copy link

dciancu commented Nov 19, 2018

Debian Stretch 9 users:
Add Jessie sources apt sources in /etc/apt/sources.list.d/jessie.list:

deb http://httpredir.debian.org/debian jessie main
deb-src http://httpredir.debian.org/debian jessie main

deb http://security.debian.org/ jessie/updates main
deb-src http://security.debian.org/ jessie/updates main

Pin openssl packages to oldstable (Jessie) in /etc/apt/preferences.d/openssl

Package: openssl libssl-dev libssl-doc libcurl4-openssl-dev libcurl3
Pin: release a=oldstable
Pin-Priority: 600

Now you will have apt-get upgrade working as well, along with security updates provided for openssl pinned packages for Jessie lifetime till June 30, 2020.

@rfay
Copy link

rfay commented Jul 29, 2019

The problem with that approach @dciancu (#939 (comment)) is that it breaks most other things that might ever want to work on Debian Stretch, right? In fact, it seems to have broken phpbrew for me.

@yanekyuk
Copy link

yanekyuk commented Sep 4, 2019

Downgrading openssl to 1.0 breaks Arch linux. Be warned. Installing openssl-1.0 and then export PKG_CONFIG_PATH=/usr/lib/openssl-1.0/pkgconfig before installing used to work for me.

@Toilal
Copy link

Toilal commented Nov 21, 2019

I hit the same issue with phpenv/php-build with Ubuntu 18.04, here's my snippet that should work on any linux distro when using --with-openssl-dir=/usr/local/openssl-1.0 --with-curl=/usr/local/curl-with-openssl-1.0 in PHP build flags and PKG_CONFIG_PATH="/usr/local/openssl-1.0/lib/pkgconfig:/usr/local/curl-with-openssl-1.0/lib/pkgconfig" environment variable. (without downgrading any system package)

  # Compile openssl-1.0 and curl from sources and export the following environment variables before compiling PHP 5.
  # PHP_BUILD_CONFIGURE_OPTS="--with-openssl-dir=/usr/local/openssl-1.0 --with-curl=/usr/local/curl-with-openssl-1.0"
  # PKG_CONFIG_PATH="/usr/local/openssl-1.0/lib/pkgconfig:/usr/local/curl-with-openssl-1.0/lib/pkgconfig"
  sudo curl -o /opt/openssl-1.0.2t.tar.gz https://www.openssl.org/source/openssl-1.0.2t.tar.gz
  sudo tar zxvf /opt/openssl-1.0.2t.tar.gz -C /opt
  sudo ln -s /opt/openssl-1.0.2t /opt/openssl-1.0
  (cd /opt/openssl-1.0 && sudo ./config shared --prefix=/usr/local/openssl-1.0 --openssldir=/usr/local/openssl-1.0 && sudo make && sudo make install)

  sudo curl -o /opt/curl-7.67.0.tar.gz https://curl.haxx.se/download/curl-7.67.0.tar.gz
  sudo tar zxvf  /opt/curl-7.67.0.tar.gz -C /opt
  sudo chown -R root:root curl-7.67.0
  sudo ln -s /opt/curl-7.67.0 /opt/curl
  (cd /opt/curl && sudo ./configure --with-ssl=/usr/local/openssl-1.0 --prefix=/usr/local/curl-with-openssl-1.0 && sudo make && sudo make install)

@morozov
Copy link
Contributor

morozov commented Nov 21, 2019

FYI, #1041 implements patching PHP 5.6 to support OpenSSL 1.1. Although, it needs a minor rework before getting accepted.

@tpraxl
Copy link

tpraxl commented Mar 11, 2020

@Toilal Thanks for your instructions on how to build and provide old openssl and curl versions. It works like a charm on Linux Mint 19.3 (Ubuntu 18.04), if you add the --with-ssl parameter:

export PKG_CONFIG_PATH="/usr/local/openssl-1.0/lib/pkgconfig:/usr/local/curl-with-openssl-1.0/lib/pkgconfig" && phpbrew install php-5.4.45 +default +mysql +sqlite +pdo -- --with-openssl --with-openssl-dir=/usr/local/openssl-1.0 --with-curl=/usr/local/curl-with-openssl-1.0

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

No branches or pull requests

10 participants