I have a project that is using DDEV to run an instance with PHP 8.1. I needed to introduce the pdo_sqlsrv extension to the package, so I added a Dockerfile in the .ddev/web-build/ directory that installs the required packages, and copies a bash-script that is then run with sudo to install the remaining dependencies.
The bash script grabs the microsoft gpg key, pulls the apt source list from packages.microsoft.com/config/$OS/$VERSION/prod.list (Where OS and Version are variables that equate to debian and 11) then it proceeds to install msodbcsql17, unixodbc and unixodbc-dev
Lastly, the bash script runs the pecl install pdo_sqlsrv command.
Everything works as expected, except the build of pdo_sqlsrv fails due to a missing file /usr/lib/x86_64-linux-gnu/libltdl.la I have searched everything I could find, and am unable to understand why this libltdl.la file is missing. I verified the libltdl-dev (2.4.6-15) package is installed. It has the other expected files like libltdl.a and libltdl.so, etc - just not the .la file.
In a desperate attempt to get this working to prevent stalling my project development, I simply copied the libltdl.la file from my local WSL2 Ubuntu 20.04 system into my .ddev/web-build/ directory, and added the following command to my Dockerfile:
COPY libltdl.la /usr/lib/x86_64-linux-gnu/
This "solves" the problem, allowing the pecl install to complete, and the resulting pdo_sqlsrv extension is compiled properly and loads as expected. However, the mystery of why this .la file is missing, and how to "properly" ensure it's installed, is still a question I wish I could understand the answer to.
If anyone is able to provide insight or replicate this, I'd greatly appreciate an understanding to make this more of a self-contained solution rather than relying on a copy of a file from my local system.
Thank you.