Two things, first of all, if you are using php with apache, it is probably more important to compile and install apr-util with openssl configuration. But if you just want php to work with your openssl build, you can do it with the following steps:
1) Suppose you created and installed your openssl in:
/opt/install2015/openssl-1.0.1p/
2) install your env var:
LD_LIBRARY_PATH=/opt/install2015/openssl-1.0.1p/lib/ PATH=/opt/install2015/openssl-1.0.1p/bin LD_RUN_PATH=/opt/install2015/openssl-1.0.1p/lib
I have two systems, one of which only works with the PATH env var set. On another old system, I need LD_x vars to be installed to make it work.
3) Your php configuration can only be:
./configure \ --with-openssl \ ...
After that run configure script, execute and do the installation.
source share