First things first, I read and tried stuff I found online even from this website, but can't get it to work.
I have an SQL SERVER 2014 running on Windows Server 2012, there I have a WAMP 64 bits running Apache on PHP 7.1.6 and need to connect to the Database, apparently the extension is not loaded because I'm getting the undefined function error.
$conn = sqlsrv_connect( $APIDBSERVER, $connection);
What I've done so far:
- Installed Microsoft® ODBC Driver 11 for SQL Server
- Downloaded PHP SQL Driver 4.0 and moved php_sqlsrv_7_nts_x64.dll to /ext
- Added them to php.ini: extension=php_pdo_sqlsrv_7_nts_x64.dll extension=php_sqlsrv_7_nts_x64.dll
Apparently the PDO also needs php_pdo.dll which WAMP doesn't have and I haven't found where to download it from, so I'm using the standard non-PDO approach
- Recently even tried enabling odbc extensions which were disabled:
extension=php_odbc.dll
extension=php_pdo_odbc.dll
I access the php.ini through the WAMP menu so I know I'm editing the right one, restarted the server several times trying different things but I've run out of ideas.
Can you please help me?
EDIT: PHP error log indicates the modules couldn't be found, but if I check that path they're right there, copy&pasted filenames into php.ini.
PHP Warning: PHP Startup: Unable to load dynamic library 'c:/wamp64/bin/php/php7.1.6/ext/php_pdo_sqlsrv_7_nts_x64.dll' - The specified module could not be found. in Unknown on line 0
PHP Warning: PHP Startup: Unable to load dynamic library 'c:/wamp64/bin/php/php7.1.6/ext/php_sqlsrv_7_nts_x64.dll' - The specified module could not be found. in Unknown on line 0
EDIT 2: Tried downgrading to 7.0.20 and get the same error, so the php.ini is fine, it just won't load them for a reason, will try to download ODBC 13.1 maybe?