Msphpsql: PHP8 support

Created on 10 Jul 2020  路  38Comments  路  Source: microsoft/msphpsql

Hi there. I'm just here to ask for the PHP8 support plans, as we now have public available alpha to test with.

php8 question

Most helpful comment

@mbiebl I assume you are referring to this: https://laravel-news.com/microsoft-dropping-php-support

The way I read that is it鈥檚 just saying that some other team in MS is no longer going to be building/supporting/maintaining PHP (platform) binary releases going forward (PHP 8+). Someone else will pick it up, though.

As far as I know, this does not change our planned driver support for PHP 8.

All 38 comments

We are working on it. We plan to support it in the next GA release at the latest (~end of January). It will probably be included in a preview release prior to that (preview dates are TBD).

It will probably be included in a preview release prior to that (preview dates are TBD).

Thx. That sounds good, it helps a lot with alpha/beta testing for our apps that require this library.

@David-Engel Can you comment on the recent news that MS is dropping support for PHP8, is that going to affect sqlsrv? And if so, how?

@mbiebl I assume you are referring to this: https://laravel-news.com/microsoft-dropping-php-support

The way I read that is it鈥檚 just saying that some other team in MS is no longer going to be building/supporting/maintaining PHP (platform) binary releases going forward (PHP 8+). Someone else will pick it up, though.

As far as I know, this does not change our planned driver support for PHP 8.

@David-Engel That's great to hear!
And yes, that was the announcement I was referring to.

@David-Engel Please take a look at https://github.com/php/php-src/pull/5805#issuecomment-661793084
8.0.0 alpha1 and alpha2 compiled, alpha3 gave a fatal eror (Windows, VC16).

Thank you @Jan-E we got it. 馃憤

This part might also help on fixing build for PHP8.0: https://github.com/microsoft/msphpsql/pull/1167

Thanks @mmokhi for your contribution! PR 1127 already took care of this issue, and since we only accept pull requests to our dev branch, that was merged to the dev branch instead.

Thanks @yitam for the clarification :blush: :pray:
One question then would be, would it be possible to get a tag on that merge commit (or later if there's a better state) for those who want to track the tags instead of commit -hashes?

hi @mmokhi we do not tag any special commit but the dev branch is maintained to work with php 8.0 previews and contains various bug fixes.

If someone is interested and don't want to struggle with building the extension, i've built the extension today, out of the current dev branch for Windows x64 PHP8.0.0beta1 Thread-Safe. Finally, i've never built PHP or any extension on windows before :)

php_sqlsrv.zip

With every new PHP 8.0.0 release I am building the php_sqlsrv.dll and php_pdo_sqlsrv.dll in all 4 variants: x64/x86, NTS/TS. And many more extensions. See https://www.apachelounge.com/viewtopic.php?t=6617

With every new PHP 8.0.0 release I am building the php_sqlsrv.dll and php_pdo_sqlsrv.dll in all 4 variants: x64/x86, NTS/TS. And many more extensions. See https://www.apachelounge.com/viewtopic.php?t=6617

Oh wow, didn't knew that. That's more handy. Thx.

With PHP 8.0.0 Beta 2 I am getting a new error for php_pdo_sqlsrv.dll. php_sqlsrv.dll builds fine. Errors for pdo:

...
pdo_util.cpp
ext\pdo_sqlsrv\pdo_stmt.cpp(727) : warning C4715: 'pdo_sqlsrv_stmt_fetch': not all control paths return a value
ext\pdo_sqlsrv\pdo_stmt.cpp(844) : warning C4715: 'pdo_sqlsrv_stmt_get_col_data': not all control paths return a value
ext\pdo_sqlsrv\pdo_dbh.cpp(915) : warning C4715: 'pdo_sqlsrv_dbh_begin': not all control paths return a value
ext\pdo_sqlsrv\pdo_dbh.cpp(957) : warning C4715: 'pdo_sqlsrv_dbh_commit': not all control paths return a value
ext\pdo_sqlsrv\pdo_dbh.cpp(996) : warning C4715: 'pdo_sqlsrv_dbh_rollback': not all control paths return a value
ext\pdo_sqlsrv\pdo_util.cpp(596): error C2664: 'void zend_update_property_string(zend_class_entry *,zend_object *,const char *,size_t,const char *)': cannot convert argument 2 from 'zval *' to 'zend_object *'
ext\pdo_sqlsrv\pdo_util.cpp(596): note: Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
Zend\zend_API.h(390): note: see declaration of 'zend_update_property_string' (compiling source file ext\pdo_sqlsrv\pdo_util.cpp)
ext\pdo_sqlsrv\pdo_util.cpp(598): error C2664: 'void zend_update_property_string(zend_class_entry *,zend_object *,const char *,size_t,const char *)': cannot convert argument 2 from 'zval *' to 'zend_object *'
ext\pdo_sqlsrv\pdo_util.cpp(598): note: Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
Zend\zend_API.h(390): note: see declaration of 'zend_update_property_string' (compiling source file ext\pdo_sqlsrv\pdo_util.cpp)
ext\pdo_sqlsrv\pdo_util.cpp(612): error C2664: 'void zend_update_property(zend_class_entry *,zend_object *,const char *,size_t,zval *)': cannot convert argument 2 from 'zval *' to 'zend_object *'
ext\pdo_sqlsrv\pdo_util.cpp(612): note: Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
Zend\zend_API.h(384): note: see declaration of 'zend_update_property' (compiling source file ext\pdo_sqlsrv\pdo_util.cpp)

Thanks @Jan-E for the heads up

I already did the forecast that you will fix it:
https://www.apachelounge.com/viewtopic.php?p=39443#39443

@Jan-E please check the dev branch again but if not fixed please let us know.

Fixed

There is another one with PHP 8.0.0 beta3:

util.cpp
ext\sqlsrv\stmt.cpp(1399): error C2677: binary '==': no global operator found which takes type 'ZEND_RESULT_CODE' (or there is no acceptable conversion)
ext\sqlsrv\conn.cpp(815): error C2677: binary '==': no global operator found which takes type 'ZEND_RESULT_CODE' (or there is no acceptable conversion)
ext\sqlsrv\conn.cpp(1268): error C2676: binary '==': 'ZEND_RESULT_CODE' does not define this operator or a conversion to a type acceptable to the predefined operator
ext\sqlsrv\conn.cpp(1320): error C2677: binary '==': no global operator found which takes type 'ZEND_RESULT_CODE' (or there is no acceptable conversion)
    "cl.exe" /I "ext\sqlsrv\shared" /DHAVE_CORE_SQLSRV_H=1 /D ZEND_WIN32_FORCE_INLINE /EHsc /GS /Zi /Qspectre /guard:cf /O2 /D COMPILE_DL_SQLSRV /D SQLSRV_EXPORTS=1 /DZEND_ENABLE_STATIC_TSRMLS_CACHE=1 /nologo /I . /I main /I Zend /I TSRM /I ext /D _WINDOWS /D WINDOWS=1 /D ZEND_WIN32=1 /D PHP_WIN32=1 /D WIN32 /D _MBCS /D _USE_MATH_DEFINES /FD /wd4996 /Qspectre /guard:cf /Zc:inline /Gw /Zc:__cplusplus /d2FuncCache1 /Zc:wchar_t /MP /Zi /LD /MD /Ox /D NDebug /D NDEBUG /D ZEND_WIN32_FORCE_INLINE /GF /D ZEND_DEBUG=0 /I "../win64build.vc16\include" /D FD_SETSIZE=1024 /DHAVE_ARGON2ID_HASH_RAW=1 /FoN:\php-sdk\php80dev\x64\Release\ext\sqlsrv\ /FpN:\php-sdk\php80dev\x64\Release\ext\sqlsrv\ /FRN:\php-sdk\php80dev\x64\Release\ext\sqlsrv\ /FdN:\php-sdk\php80dev\x64\Release\ext\sqlsrv\ /c ext\sqlsrv\conn.cpp ext\sqlsrv\init.cpp ext\sqlsrv\stmt.cpp ext\sqlsrv\util.cpp
conn.cpp
init.cpp
stmt.cpp
util.cpp
ext\sqlsrv\stmt.cpp(1399): error C2677: binary '==': no global operator found which takes type 'ZEND_RESULT_CODE' (or there is no acceptable conversion)
ext\sqlsrv\conn.cpp(815): error C2677: binary '==': no global operator found which takes type 'ZEND_RESULT_CODE' (or there is no acceptable conversion)
ext\sqlsrv\conn.cpp(1268): error C2676: binary '==': 'ZEND_RESULT_CODE' does not define this operator or a conversion to a type acceptable to the predefined operator
ext\sqlsrv\conn.cpp(1320): error C2677: binary '==': no global operator found which takes type 'ZEND_RESULT_CODE' (or there is no acceptable conversion)

I guess this is related to https://github.com/php/php-src/commit/45ece5bf195e47d81df52da0c3e07b07d671fcf8

Thanks again @Jan-E and I'll get back to you

@Jan-E just merged in the pull request #1184

Fixed

When it will be available thanks for the great work.

hi @terabytesoftw, fyi we tentatively plan to upload a preview to pecl soon after PHP 8 RC1 is out.

FYI, there will be a delay for our preview release because the release date of PHP 8 RC 1 has been postponed to Oct 01 2020.

Yesterday I checked the NEWS in PHP master: 8.0.0 RC1. I modified my installer to fetch RC1. Today, to my surprise, 8.0.0 beta 4 was released. So I compiled beta 4, without problems for the 2 Sqlsrv DLL's.

For your interest, 5.9.0-preview1 is just released, which supports PHP 8 RC 1.

For your interest, 5.9.0-preview1 is just released, which supports PHP 8 RC 1.

Thanks excellent work, it works perfect.

PHP 8.0.0 released on 26 Nov 2020.

Yes @onecentlin we know. We plan to release another preview, tentatively.

@yitam it seems that there is an inconsistency in the package name convention. The pecl package is named 5.9.0preview1 were phpversion('sqlsrv'); will produce the output 5.9.0-preview1 (containing a dash).

As those two don't match our logic fails to detect the proper installation of the (pdo_)sqlsrv pecl package.

Hi @hkraal, it was a deliberate decision years ago, as explained in the README. For stable releases, the versions match however.

For those that want to test the current preview version with PHP 8.0.0 on Windows:
I always build a lot of extensions from git head and publish them at https://www.apachelounge.com/viewtopic.php?p=29661#29661

Just released 5.9.0-beta2 today. This will be the last preview before the stable release.

Closing this issue now. If any of you encounter any problem please create a new issue.

Was this page helpful?
0 / 5 - 0 ratings