Thanks for the request, and glad LAMP is useful to you.
One naming detail first: php-mssql no longer exists. The ext/mssql extension was removed from PHP in 7.0, so there is no such package for any PHP version LAMP ships (7.4 to 8.5).
Two things replaced it, and they are very different in cost.
pdo_dblib, the FreeTDS based driver, is a single Debian package (php8.x-sybase). Connection string is dblib:host=...;dbname=.... It pulls nothing from outside Ubuntu and weighs a few kilobytes. I can add that to the image.
The actual Microsoft drivers (sqlsrv and pdo_sqlsrv) are another matter. They are not packaged for Debian or Ubuntu, they have to be compiled with pecl, they need Microsoftâs own ODBC driver from Microsoftâs repository under Microsoftâs licence, and the current release requires PHP 8.3 or newer so older LAMP images would need pinned older versions. That means a build toolchain in the image, a third party proprietary repository, and a licence question I have not settled. I would rather not carry that for a single request. If more people need it, we can revisit.
So, before I add anything, I need to know what your app actually calls. A grep in your source is enough:
grep -rn "sqlsrv_\|PDO(\"sqlsrv\|PDO('sqlsrv\|PDO(\"dblib\|PDO('dblib\|odbc_connect" /path/to/your/app
Replace /path/to/your/app with your source directory. It lists every line where the code opens a SQL Server connection. Check the matched lines before pasting here, people often keep the DSN and the password on the same line.
Also useful, your current PHP version and loaded extensions. As root on the node, replacing lamp1 if your instance name differs:
runagent -m lamp1 podman exec apache2-app php -v
runagent -m lamp1 podman exec apache2-app php -m
First line gives the PHP version, second lists the extensions. Nothing sensitive in there.
If your code uses dblib: or generic PDO, the FreeTDS route covers you. If it calls sqlsrv_* or PDO("sqlsrv:...") directly, pdo_dblib will not help and you would need to port those calls to PDO.