[php-src] Issue #8683: Windows Server 2019 PHP 8.1.6 Connecting to MS SQL server with PDO
| From: | knlklabacka | Date: | Wed, 01 Jun 2022 17:40:34 +0000 |
| Subject: | [php-src] Issue #8683: Windows Server 2019 PHP 8.1.6 Connecting to MS SQL server with PDO | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-241642@lists.php.net to get a copy of this message | ||
Issue: https://github.com/php/php-src/issues/8683
Author: knlklabacka
### Description
The following code:
```php
<?php
$dsn = "DRIVER={ODBC Driver 17 for SQL
Server};SERVER=".$host.";PORT=".DB_PORT.";DATABASE=".DB_DATABASE;
$options = array(PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION, PDO::ATTR_ORACLE_NULLS =>
PDO::NULL_EMPTY_STRING);
$db_handler = new PDO($dsn, DB_USER, DB_PASS);
foreach ($options as $opt => $value) {
$db_handler->setAttribute($opt, $value);
}
print '<pre>';
var_dump($db_handler);
print '</pre>';
```
Resulted in this output:
```I get a server 500 status code. Event Viewer shows
Faulting application name: php-cgi.exe, version: 8.1.6.0, time stamp: 0x627b7a77
Faulting module name: ucrtbase.dll, version: 10.0.17763.1490, time stamp: 0x48ac8393
Exception code: 0xc0000409
Fault offset: 0x000000000006e77e
Faulting process id: 0x1474
Faulting application start time: 0x01d875dc18b9b925
Faulting application path: C:\Program Files\PHP8\php-cgi.exe
Faulting module path: C:\Windows\System32\ucrtbase.dll
Report Id: 731ed3d6-d03d-4647-a7bf-3727789f2c59
Faulting package full name:
Faulting package-relative application ID
```
But I expected this output instead:
```
```
### PHP Version
8.1
### Operating System
Windows Server 2019 Standard