if (options != 0) {
#if PHP_VERSION_ID >= 80600
php_stream_wrapper_log_error(wrapper, NULL, options, E_WARNING, 0, ZEND_ENUM_StreamErrorCode_Generic, "Invalid option: no options except REPORT_ERRORS may be specified with a sqlsrv stream");
#else
php_stream_wrapper_log_error(wrapper, options, "Invalid option: no options except REPORT_ERRORS may be specified with a sqlsrv stream");
#endif
return NULL;
}
Below are the 2 files that need some change to bring in support for PHP8.6
File
Change
source\\shared\\core_stream.cpp
Added a PHP 8.6-specific call to the changed php_stream_wrapper_log_error() API, supplying the stream context and new error arguments. The older signature remains for earlier PHP versions. This shared code affects both drivers.
source\\sqlsrv\\init.cpp
Replaced the removed INI_BOOL / INI_INT macros with zend_ini_long(), preserving existing numeric parsing, boolean conversion and configuration behavior.
We can share our learning and keep this thread posted. 🚀
Activity
David-Engel commented on Sep 14, 2026
That's the plan:
https://github.com/microsoft/msphpsql/milestone/1
Beta of the SQL drivers soon after PHP 8.6 RC1, then GA soon after PHP 8.6 GA.
SharkMachine commented on Sep 24, 2026
It doesn't build because of
msphpsql/source/shared/core_stream.cpp
Line 280 in a218e23
If you fix that, it builds and seems to work as well.
SharkMachine commented on Sep 24, 2026
I've only tested pdo_sqlsrv. There might be other issues with sqlsrv.
Jan-E commented on Sep 24, 2026
Fix for php_stream_wrapper_log_error is here:
php/php-src#22958 (comment)
if (options != 0) { #if PHP_VERSION_ID >= 80600 php_stream_wrapper_log_error(wrapper, NULL, options, E_WARNING, 0, ZEND_ENUM_StreamErrorCode_Generic, "Invalid option: no options except REPORT_ERRORS may be specified with a sqlsrv stream"); #else php_stream_wrapper_log_error(wrapper, options, "Invalid option: no options except REPORT_ERRORS may be specified with a sqlsrv stream"); #endif return NULL; }jahnvi480 commented on Sep 25, 2026
hebbet Jan Ehrhardt (@Jan-E) Petri Haikonen (@SharkMachine) even I have created one branch for testing the changes for PHP8.6 https://github.com/microsoft/msphpsql/tree/jahnvi/php86-driver-compatibility
Below are the 2 files that need some change to bring in support for PHP8.6
We can share our learning and keep this thread posted. 🚀
SharkMachine commented on Sep 25, 2026
The fix is similar to the quick hack I made in shared\core_stream.cpp. It works for me 👍 .