11

I've installed the following packages on my Debian 6.0, after setting my versions in the sources.list to 7.0:

  • libssl-dev
  • openssl
  • openssl-common

I've verified that /usr/include/openssl/evp.h exists with a permission of 777, and then I've ran ./configure like this:

./configure --with-zlib-dir --with-freetype-dir --enable-mbstring --with-libxml-dir=/usr --enable-soap --enable-calendar --with-mcrypt --disable-rpath --enable-inline-optimization --with-zlib --enable-sockets --enable-sysvsem --enable-sysvshm --enable-pcntl --enable-mbregex --enable-exif --enable-bcmath --with-mhash --enable-zip --with-pcre-regex --with-mysql --with-pdo-mysql --with-mysqli --enable-gd-native-ttf --with-fpm-user=www-data --with-fpm-group=www-data --enable-ftp --with-kerberos --with-gettext --with-xmlrpc --enable-opcache --with-apxs2=/usr/bin/apxs2 --with-config-file-path=/etc/php5/apache2 --with-config-file-scan-dir=/etc/php5/conf.d --with-openssl-dir=/usr/include/openssl

However, I still get an error from configure that evp.h could not be found.

4
  • No, I resorted to using yum in CentOS and the remi-php55 repository. You can use the ondrej repository for Debian and rid yourself of the trouble. Commented Sep 20, 2014 at 4:45
  • See serverfault.com/a/544149/155703 Commented Nov 14, 2014 at 14:38
  • I also have this exact error. Any help is greatly appreciated. Commented Jul 29, 2015 at 4:04
  • @RandomSeed all test cases fail with the links advice Commented Jul 29, 2015 at 4:18

3 Answers 3

11

I was struggling with this problem for a long time, and this ended up working for me:

Instead of --with-openssl-dir=/usr/include/openssl just use --with-openssl

Sign up to request clarification or add additional context in comments.

4 Comments

In my case (7.1.0RC3), --with-openssl is not a configuration. However, --with-openssl-dir did fix my problem. Thank you so much :D
if you check the command ./configure --help you will see this line : --with-openssl-dir=DIR SNMP: openssl install prefix. It's concerning SNMP only.
Thank you for adding this answer. It helped me and this is still relevant. I was building PHP 7.3.5 on Debian 9 (May-2019)!
worked for me installing PHP 7.1.3 from source on ubuntu 18.04
11

If ./configure ... can not find /usr/include/openssl/evp.h it is most likely you have not installed openssl, namely the header. So if you are using CentOs you should first do:

yum install openssl-devel 

Comments

4

It's a bug in php bug

The cause of this is because after running the command 'phpize' the configure script has a variable (PHP_OPENSSL_DIR) that is not set "yes"

So you should do:

export PHP_OPENSSL_DIR=yes ./configure -with-openssl-dir=/usr/include/openssl 

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.