2

I am trying to install PHP 5.4 with PHPBrew but have those errors:

-> % phpbrew install 5.4.6 +default +apxs2 +mysql                              
===> phpbrew will now build 5.4.6
===> Loading and resolving variants...
Checking distribution checksum...
Checksum matched: c9aa0f4996d1b91ee9e45afcfaeb5d2e
===> 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/breq/.phpbrew/build/php-5.4.6' --quiet 'clean'
===> Checking patches...
Checking patch for replace apache php module name with custom version name
0 changes patched.
Found existing build.log, renaming it to /home/breq/.phpbrew/build/php-5.4.6/build.log.1466515643
===> Configuring 5.4.6...


Use tail command to see what's going on:
   $ tail -F /home/breq/.phpbrew/build/php-5.4.6/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/breq/.phpbrew/build/php-5.4.6/ext/openssl/xp_ssl.c:355: undefined reference to `SSLv3_server_method'

/home/breq/.phpbrew/build/php-5.4.6/ext/openssl/xp_ssl.c:343: undefined reference to `SSLv3_client_method'

collect2: error: ld returned 1 exit status

Makefile:244: recipe for target 'sapi/cli/php' failed

make: *** [sapi/cli/php] Error 1

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

With +openssl

-> % phpbrew install 5.4.6 +default +apxs2 +mysql +openssl=/usr/include/openssl
===> phpbrew will now build 5.4.6
===> Loading and resolving variants...
Checking distribution checksum...
Checksum matched: c9aa0f4996d1b91ee9e45afcfaeb5d2e
===> 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/breq/.phpbrew/build/php-5.4.6' --quiet 'clean'
===> Checking patches...
Checking patch for replace apache php module name with custom version name
0 changes patched.
Found existing build.log, renaming it to /home/breq/.phpbrew/build/php-5.4.6/build.log.1466516015
===> Configuring 5.4.6...


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


Error: Configure failed:
The last 5 lines in the log file:
checking for Kerberos support... no

checking for DSA_get_default_method in -lssl... no

checking for X509_free in -lcrypto... yes

checking for pkg-config... /usr/bin/pkg-config

configure: error: Cannot find OpenSSL's <evp.h>

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

My OS: Xubuntu 16.10 + PHP 7.07

-> % tail /home/lmalicki/.phpbrew/build/php-5.4.6/build.log
checking whether to enable LIBXML support... yes
checking libxml2 install dir... /usr
checking for xml2-config path... /usr/bin/xml2-config
checking whether libxml build works... yes
checking for OpenSSL support... yes
checking for Kerberos support... no
checking for DSA_get_default_method in -lssl... no
checking for X509_free in -lcrypto... yes
checking for pkg-config... /usr/bin/pkg-config
configure: error: Cannot find OpenSSL's <evp.h>
breq
  • 24,412
  • 26
  • 65
  • 106

4 Answers4

0

I look like you're missing some dependencies.

Try with install ssl dev package first:

apt-get install libssl-dev

PHPBrew just downloads and compiles php, but it doesn't install required dependecies in your OS.

EDIT:

I've just noticed that you've provided path for openssl library in +openssl=/usr/include/openssl.

Are you sure it's there? You can check it with which openssl. This command will return the path of openssl binary.

Also you may try to simply remove the path, since PHPBrew should find proper binary on it's own.

Jakub Matczak
  • 15,341
  • 5
  • 46
  • 64
  • -> % sudo apt-get install libssl-dev Reading package lists... Done Building dependency tree Reading state information... Done libssl-dev is already the newest version (1.0.2h-1+deb.sury.org~xenial+1). 0 upgraded, 0 newly installed, 0 to remove and 40 not upgraded. – breq Jun 21 '16 at 13:51
0

Since +openssl directive is actually providing a prefix not an include path, try

+openssl=/usr -- --with-libdir=lib64
canto
  • 23
  • 6
  • with this solution I'm having: checking for Kerberos support... no checking for DSA_get_default_method in -lssl... no checking for X509_free in -lcrypto... yes checking for pkg-config... /usr/bin/pkg-config configure: error: Cannot find OpenSSL's libraries – breq Jun 21 '16 at 15:44
  • Can you paste whole build log not just last 10 lines including the configure command? – canto Jun 22 '16 at 11:30
0
configure: error: Cannot find OpenSSL's <evp.h>

This problem may happen if you have newer version of OpenSSL installed then your distribution provided.

If you use ubuntu you may need to downgrade your packages back. ( but probably you have installed a different version for a reason so be careful here )

#file etc/apt/preferences.d/allow-downgrade

Package: *
Pin: release o=Ubuntu
Pin-Priority: 1001

then

sudo apt-get update 
sudo apt-get upgrade

and options

 -- --with-openssl=/path/to/libs 

or

+openssl

should work just fine.

If you already have some misfunctioning PHP installed from PHPbrew don't forget to switch with

phpbrew switch recently_installed_php_ver_number_here
Pawel Dubiel
  • 18,665
  • 3
  • 40
  • 58
0

On Ubuntu 16.10

sudo apt-get install libssl-dev
sudo apt-get install libcurl4-openssl-dev
sudo apt-get install clibcurl4-openssl-dev pkg-config libssl-dev libsslcommon2-dev

then re-run

phpbrew install 5.4.6 +default +apxs2 +mysql +openssl=/usr/include/openssl
unixmiah
  • 3,081
  • 1
  • 12
  • 26