Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PHP8 support #1154

Closed
brainfoolong opened this issue Jul 10, 2020 · 38 comments
Closed

PHP8 support #1154

brainfoolong opened this issue Jul 10, 2020 · 38 comments

Comments

@brainfoolong
Copy link

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

@David-Engel
Copy link
Contributor

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).

@brainfoolong
Copy link
Author

brainfoolong commented Jul 11, 2020

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.

@mbiebl
Copy link

mbiebl commented Jul 13, 2020

@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?

@David-Engel
Copy link
Contributor

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

The way I read that is it’s 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.

@mbiebl
Copy link

mbiebl commented Jul 13, 2020

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

@yitam yitam added the question label Jul 20, 2020
@Jan-E
Copy link

Jan-E commented Jul 21, 2020

@David-Engel Please take a look at php/php-src#5805 (comment)
8.0.0 alpha1 and alpha2 compiled, alpha3 gave a fatal eror (Windows, VC16).

@yitam
Copy link
Contributor

yitam commented Jul 21, 2020

Thank you @Jan-E we got it. 👍

@mmokhi
Copy link

mmokhi commented Jul 27, 2020

This part might also help on fixing build for PHP8.0: #1167

@yitam
Copy link
Contributor

yitam commented Jul 27, 2020

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.

@mmokhi
Copy link

mmokhi commented Jul 31, 2020

Thanks @yitam for the clarification 😊 🙏
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?

@yitam
Copy link
Contributor

yitam commented Aug 4, 2020

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.

@brainfoolong
Copy link
Author

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

@Jan-E
Copy link

Jan-E commented Aug 10, 2020

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

@brainfoolong
Copy link
Author

brainfoolong commented Aug 10, 2020

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.

@Jan-E
Copy link

Jan-E commented Aug 19, 2020

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)

@Jan-E
Copy link

Jan-E commented Aug 19, 2020

@yitam
Copy link
Contributor

yitam commented Aug 19, 2020

Thanks @Jan-E for the heads up

@Jan-E
Copy link

Jan-E commented Aug 19, 2020

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

@yitam
Copy link
Contributor

yitam commented Aug 19, 2020

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

@Jan-E
Copy link

Jan-E commented Aug 19, 2020

Fixed

@Jan-E
Copy link

Jan-E commented Sep 1, 2020

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 php/php-src@45ece5b

@yitam
Copy link
Contributor

yitam commented Sep 1, 2020

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

@Jan-E
Copy link

Jan-E commented Sep 1, 2020

Should be php/php-src@fa8d9b1 I think now. That one is only beta3.

@yitam
Copy link
Contributor

yitam commented Sep 1, 2020

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

@Jan-E
Copy link

Jan-E commented Sep 2, 2020

Fixed

@yitam yitam added the php8 label Sep 3, 2020
@terabytesoftw
Copy link

terabytesoftw commented Sep 5, 2020

When it will be available thanks for the great work.

@yitam
Copy link
Contributor

yitam commented Sep 8, 2020

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

@yitam
Copy link
Contributor

yitam commented Sep 15, 2020

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.

@Jan-E
Copy link

Jan-E commented Sep 15, 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.

@yitam
Copy link
Contributor

yitam commented Oct 6, 2020

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

@terabytesoftw
Copy link

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

Thanks excellent work, it works perfect.

@onecentlin
Copy link

PHP 8.0.0 released on 26 Nov 2020.

@yitam
Copy link
Contributor

yitam commented Nov 27, 2020

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

@hkraal
Copy link

hkraal commented Dec 1, 2020

@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.

@yitam
Copy link
Contributor

yitam commented Dec 1, 2020

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

@Jan-E
Copy link

Jan-E commented Dec 2, 2020

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

@yitam
Copy link
Contributor

yitam commented Dec 2, 2020

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

@yitam
Copy link
Contributor

yitam commented Dec 8, 2020

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

9 participants