How to recompile PHP with either NTS or TS?

I am trying to get SQLSRV PDO to work with PHP. I run PHP -v and get the following error Warning: PHP Startup: pdo_sqlsrv: Unable to initialize module Module compiled with build ID=API20180718,NTS...