How do I make my PHP Source installation use the libraries inside of /usr/local/programname/lib
instead or /usr/local/lib
?
I have tried setting LD_LIBRARY_PATH to each of the program names like LD_LIBRARY_PATH="/usr/local/programname1/lib:/usr/local/programname2/lib:/usr/local/programname3/lib"
.
And, I logged out. Even ran source /etc/environment
(I have put the LD_LIBRARY_PATH variable in /etc/environment), even rebooted the system.
But still, when I run ./configure --with-openssl --with-curl
, it tells me that libssl does not exist.
I do not want to use the libssl-dev
and libcurl-dev
package provided by apt, because I need the newest versions, for testing.
And, I noted that: If I install the program's lib directory in /usr/local/lib
instead of /usr/local/programname/lib
, it works without setting any environment variables.
But, in my opinion, /usr/local/programname/lib
is more clear, so I want to use this type of path.
How can I make it so that PHP uses the libraries inside /usr/local/programname/lib
instead of /usr/local/lib
? By that I mean that, I want to give more priority to /usr/local/programname/lib
than other lib
directories.
programname
refers to the name of each of the programs that is installed inside of /usr/local
.
I even tried to use /etc/ld.so.conf.d/programname.conf
(I wrote /usr/local/programname
inside it), and ran ldconfig
. But still no luck.
Btw, I am using Ubuntu 20.10
Edit:
"Don't fight the system's conventions" - I can't just move on like that. I have to try to do this, or I will just be stuck, and be dependent on the kinda old packages that apt gives me (even if it gives me the newest ones, I cannot for example: use http/3 and test it and more..). And, no testing will be possible. I do this to make my programs future proof, and even to have fun experimenting these. By testing with programs that are new. Installing in /usr/local
doesn't feel good, because I test with multiple versions of the libraries. Like I test with OpenSSL 1.1.1i and OpenSSL 3.0.0, and other versions too. So, installing to /usr/local will not benefit me on this, but installing to /usr/local/openssl-1.1.1i
and /usr/local/openssl-3.0.0
will be more clean, and will save me more time. I can't just keep running make install
and make uninstall
every time. Not only OpenSSL, even cURL, and other packages.