I am trying to compile PHP7.0.1 on CentOS 6.7 with openssl support but I am getting an error. I have narrowed the issue to openssl because I can compile php fine when I remove "--with-openssl" and "--with-openssl-dir" from the configure command below.
I thought it might be a problem with the version of openssl so I upgraded it to openssl-1.0.2e. I know this worked because when I issue "/usr/bin/openssl version" I get "OpenSSL 1.0.2e 3 Dec 2015". This also confirms the path to this version of openssl.
Here is my full configure command:
./configure --prefix=/usr/lib/php701 \
--with-apxs2=/usr/local/apacheALL2412/bin/apxs \
--sysconfdir=/usr/lib/php701/phpini \
--localstatedir=/var \
--datadir=/usr/share/php \
--mandir=/usr/share/man \
--enable-fpm \
--with-fpm-user=apache2412 \
--with-fpm-group=apache2412 \
--with-config-file-path=/usr/lib/php701/phpini \
--with-zlib \
--enable-bcmath \
--with-bz2 \
--enable-calendar \
--enable-dba=shared \
--with-gdbm \
--with-gmp \
--enable-ftp \
--with-gettext \
--enable-mbstring \
--with-libxml-dir=/usr/lib/php701/xml2 \
--enable-xml \
--with-curl=/opt/curlssl/ \
--with-mysql \
--with-mysql-sock=/var/lib/mysql/mysql.sock \
--with-mysqli \
--enable-mysqlnd \
--with-openssl=/usr \
--with-openssl-dir=/usr/bin \
--with-pdo-mysql \
--with-readline && \
make
I have tried different values of "--with-openssl" and "--with-openssl-dir" but I still get the error below.
Here is the error:
ext/openssl/.libs/xp_ssl.o: In function `php_openssl_setup_crypto':
/Timstmp/PHP701-Source/php-7.0.1/ext/openssl/xp_ssl.c:1599:
undefined reference to `SSL_CTX_set_alpn_protos'
/Timstmp/PHP701-Source/php-7.0.1/ext/openssl/xp_ssl.c:1604:
undefined reference to `SSL_CTX_set_alpn_select_cb'
ext/openssl/.libs/xp_ssl.o: In function `php_openssl_sockop_set_option':
/Timstmp/PHP701-Source/php-7.0.1/ext/openssl/xp_ssl.c:2305:
undefined reference to `SSL_get0_alpn_selected'
collect2: ld returned 1 exit status
make: *** [sapi/cli/php] Error 1