unit icon indicating copy to clipboard operation
unit copied to clipboard

fix php_module_startup call for PHP 8.2

Open remicollet opened this issue 2 years ago • 15 comments

Without this patch

+ : PHP module configuration
+ ./configure php --config=/opt/remi/php82/root/usr/bin/php-config --module=php82
configuring PHP module
checking for PHP ... found
 + PHP SAPI: [apache2handler litespeed fpm phpdbg cli embed cgi]
checking for PHP version ... 8.2.0-dev
checking for PHP embed SAPI ... not found

./configure: error: no PHP embed SAPI found.

remicollet avatar Jun 02 '22 14:06 remicollet

Thanks @remicollet for pointing this out! Did you have a link to the C API changelog just for documentation? That would be perfect!

tippexs avatar Jun 07 '22 23:06 tippexs

@artemkonev We should add a changelog for this, right? Supporting PHP 8.2

alejandro-colomar avatar Jun 07 '22 23:06 alejandro-colomar

Did you have a link to the C API changelog just for documentation?

Sorry nothing in UPGRADINGS (perhaps @Girgias may help, as he changes it in https://github.com/php/php-src/commit/b5db594fd27)

@artemkonev We should add a changelog for this, right? Supporting PHP 8.2

Probably too early, alpha1 will be announced tomorrow, API is not yet final, better to wait for RC and final API

remicollet avatar Jun 08 '22 08:06 remicollet

Did you have a link to the C API changelog just for documentation?

Sorry nothing in UPGRADINGS (perhaps @Girgias may help, as he changes it in php/php-src@b5db594fd27)

@artemkonev We should add a changelog for this, right? Supporting PHP 8.2

Probably too early, alpha1 will be announced tomorrow, API is not yet final, better to wait for RC and final API

Oh, I forgot to add an entry ._.

Girgias avatar Jun 08 '22 10:06 Girgias

So, https://github.com/php/php-src/blob/master/UPGRADING.INTERNALS#L65

remicollet avatar Jun 08 '22 13:06 remicollet

Did you have a link to the C API changelog just for documentation?

Sorry nothing in UPGRADINGS (perhaps @Girgias may help, as he changes it in php/php-src@b5db594fd27)

@artemkonev We should add a changelog for this, right? Supporting PHP 8.2

Probably too early, alpha1 will be announced tomorrow, API is not yet final, better to wait for RC and final API

Okay, so please ping when you have an RC. I'll leave this open for now.

Thanks!

alejandro-colomar avatar Jun 10 '22 13:06 alejandro-colomar

Okay, so please ping when you have an RC. I'll leave this open for now.

You can merge the "code" fix without updating the "doc" claiming it is 8.2 compatible ;)

P.S. obviously I will forget the ping....

remicollet avatar Jun 10 '22 13:06 remicollet

Okay, so please ping when you have an RC. I'll leave this open for now.

You can merge the "code" fix without updating the "doc" claiming it is 8.2 compatible ;)

That also makes sense.

@artemkonev What do we say in the changelog?

P.S. obviously I will forget the ping....

To be expected :)

alejandro-colomar avatar Jun 11 '22 09:06 alejandro-colomar

PHP 8.2.0 RC4 released, using this patch to build module - it works perfect, please commit the fix

andypost avatar Oct 12 '22 15:10 andypost

Looks good to me. I think we can already add the changelog now, since I wouldn't expect big breaking changes after the RC. Thank you!

alejandro-colomar avatar Oct 14 '22 11:10 alejandro-colomar

Heh, I think they can be squashed into a single commit...

ac000 avatar Oct 14 '22 11:10 ac000

Heh, I think they can be squashed into a single commit...

Actually I'd squash them into 2. The fixes for existing style I'd keep them separate. I can do that at the moment of applying, so no problem.

alejandro-colomar avatar Oct 14 '22 11:10 alejandro-colomar

You mean squash the two brackets patches into one?

ac000 avatar Oct 14 '22 12:10 ac000

You mean squash the two brackets patches into one?

I'd do a selective interactive rebase so that one of the brackets and part of the other are squasehd into the main commit, and then part of one of the brakcet commits still survives as separate.

alejandro-colomar avatar Oct 14 '22 12:10 alejandro-colomar

Ah, OK I see now, the 'add more brackets' patch is touching a lot of 'other' code, I did wonder why there was two 'bracket' patches...

ac000 avatar Oct 14 '22 12:10 ac000

Hi!

I rebased to master, rewrote the commit logs, and signed on your behalf:

$ git log -2
commit 370e290c37fc2490fb4e02512a3ce3a8698ffe3b (HEAD -> php)
Author: Remi Collet <[email protected]>
Date:   Fri Oct 14 12:16:43 2022 +0200

    Added parentheses for consistency.
    
    Reported-by: Andrew Clayton <[email protected]>
    Signed-off-by: Remi Collet <[email protected]>
    Reviewed-by: Andrew Clayton <[email protected]>
    Signed-off-by: Alejandro Colomar <[email protected]>

commit 8b4fe01e0663f3d6418bcdaf195bf72bca56cea8
Author: Remi Collet <[email protected]>
Date:   Thu Jun 2 16:16:35 2022 +0200

    PHP: Fixed php_module_startup() call for PHP 8.2.
    
    PHP 8.2 changed the prototype of the function, removing the last
    parameter.
    
    Signed-off-by: Remi Collet <[email protected]>
    Cc: Timo Stark <[email protected]>
    Cc: George Peter Banyard <[email protected]>
    Tested-by: Andy Postnikov <[email protected]>
    Acked-by: Andy Postnikov <[email protected]>
    Reviewed-by: Andrew Clayton <[email protected]>
    Signed-off-by: Alejandro Colomar <[email protected]>

And added the following changelog:

diff --git a/docs/changes.xml b/docs/changes.xml
index 5da00d88..96877044 100644
--- a/docs/changes.xml
+++ b/docs/changes.xml
@@ -31,6 +31,12 @@ NGINX Unit updated to 1.29.0.
          date="" time=""
          packager="Nginx Packaging &lt;[email protected]&gt;">
 
+<change type="feature">
+<para>
+compatibility with PHP 8.2.
+</para>
+</change>
+
 <change type="feature">
 <para>
 support rack v3 in ruby applications.

I'll push this in a moment.

alejandro-colomar avatar Oct 19 '22 10:10 alejandro-colomar

Merged.

alejandro-colomar avatar Oct 19 '22 13:10 alejandro-colomar

Hi, are there any plans for releasing (as 1.28.1) this prior to PHP 8.2.0 stable release (planned for December 8th 2022)?

Vrtak-CZ avatar Nov 30 '22 23:11 Vrtak-CZ

Hi guys, PHP 8.2.0 has been released. Are there any plans for releasing a new version of Nginx Unit with this fix?

Vrtak-CZ avatar Dec 08 '22 13:12 Vrtak-CZ

Hi!

Yes, if all goes well, we'll release in a week or so.

Cheers, Alex

alejandro-colomar avatar Dec 08 '22 15:12 alejandro-colomar