how to compile php with openssl

alipour66m

Verified User
Joined
Feb 22, 2013
Messages
65
I want to make https call, my script needs it
how to compile php with openssl
my server is very important for me
does it make server downtime ?
is it safe to do it?
php version : 5.6 (mod php)
custom build 2
centos 6.X (yum -y update every day :p)
 

zEitEr

Super Moderator
Joined
Apr 11, 2005
Messages
14,255
Location
GMT +7.00
Hello,

All the PHP versions are build with "--with-openssl" support from a box. Why do you think it does not work for you?

Code:
[root@server configure]# cd /usr/local/directadmin/custombuild/configure
[root@server configure]#  grep 'with-openssl' ./*/configure.php* --color
./ap2/configure.php53:  --with-openssl \
./ap2/configure.php54:  --with-openssl \
./ap2/configure.php55:  --with-openssl \
./ap2/configure.php56:  --with-openssl \
./ap2/configure.php70:  --with-openssl \
./fastcgi/configure.php53:      --with-openssl \
./fastcgi/configure.php54:      --with-openssl \
./fastcgi/configure.php55:      --with-openssl \
./fastcgi/configure.php56:      --with-openssl \
./fastcgi/configure.php70:      --with-openssl \
./fpm/configure.php53:  --with-openssl \
./fpm/configure.php54:  --with-openssl \
./fpm/configure.php55:  --with-openssl \
./fpm/configure.php56:  --with-openssl \
./fpm/configure.php70:  --with-openssl \
./litespeed/configure.php53:    --with-openssl \
./litespeed/configure.php54:    --with-openssl \
./litespeed/configure.php55:    --with-openssl \
./litespeed/configure.php56:    --with-openssl \
./litespeed/configure.php70:    --with-openssl \
./suphp/configure.php53:        --with-openssl \
./suphp/configure.php54:        --with-openssl \
./suphp/configure.php55:        --with-openssl \
./suphp/configure.php56:        --with-openssl \
./suphp/configure.php70:        --with-openssl \
[root@server configure]#
There is no need to change anything manually. Just check

PHP:
<?php
phpinfo();
output in a browser.
 

Frej

Verified User
Joined
Jun 15, 2008
Messages
156
because when you install php 7.0.11 normally via custombuild it comes with a outdated openssl
OpenSSL/1.0.1e

when latest version is OpenSSL 1.0.2j which fixes security issues
i also want to know how to compile php with latest openssl versions
 

zEitEr

Super Moderator
Joined
Apr 11, 2005
Messages
14,255
Location
GMT +7.00
By default all the PHP versions are build against openssl which is installed on your box from an OS repo. To get PHP installed against a newer OpenSSL version you should either install it globally or as the second instance. And here is guide:

http://forum.directadmin.com/showthread.php?t=51556&p=265520#post265520 (available in a public since 06-11-2015)

Just make sure to download the desired OpenSSL version instead of that one in the guide. The steps will be always the same.
 

MartinG

New member
Joined
Oct 13, 2017
Messages
1
Thanks for the link ref, great link

By default all the PHP versions are build against openssl which is installed on your box from an OS repo. To get PHP installed against a newer OpenSSL version you should either install it globally or as the second instance. And here is guide:

http://forum.directadmin.com/showthread.php?t=51556&p=265520#post265520 (available in a public since 06-11-2015)

Just make sure to download the desired OpenSSL version instead of that one in the guide. The steps will be always the same.
Great info on that link! From the cli, when I curl it shows as using TLS 1.2 which is great!

Problem for me is that the php applications are still using the old version.. Do you have some advice on what next steps I need to do?

phpinfo() configure common output shows us the problem --with-openssl=/usr' '--with-openssl-dir=/usr'
 
Top