configuration – How do I make my PHP Source installation use the libraries inside of /usr/local/programname/lib instead or /usr/local/lib?

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?

programname refers to the name of each of the programs that is installed inside of /usr/local.