Install freetds-devel using:
dnf install freetds-devel freetds freetds-libs
then download the php version you want to compile the library for:
https://www.php.net/downloadsextract files from the downloaded archive, then CD to:
php-X.X.X/ext/pdo_dblib
/opt/alt/phpXX/usr/bin/phpize
./configure --with-php-config=/opt/alt/phpXX/usr/bin/php-config --with-pdo-dblib
make
make install
create file pdo_dblib.ini in /opt/alt/phpXX/etc/php.d/ and put the line:
extension=pdo_dblib.so
into the file.
Adopt the instructions according to your paths and php version.