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

Brotli 0.15.2 cannot build .dll for PHP NST 8.4.1 #55

Open
vietgiaitri opened this issue Nov 29, 2024 · 22 comments
Open

Brotli 0.15.2 cannot build .dll for PHP NST 8.4.1 #55

vietgiaitri opened this issue Nov 29, 2024 · 22 comments

Comments

@vietgiaitri
Copy link

vietgiaitri commented Nov 29, 2024

D:\>cd D:\tools\PHP\php-sdk-2.3.0

D:\tools\PHP\php-sdk-2.3.0>phpsdk-vs17-x64.bat
[vcvarsall.bat] Environment initialized for: 'x64'

PHP SDK 2.3.0

OS architecture:    x64
Build architecture: x64
Visual C++:         14.42.34433.0
PHP-SDK path:       D:\tools\PHP\php-sdk-2.3.0

D:\tools\PHP\php-sdk-2.3.0
$ cd D:\tools\PHP\brotli

D:\tools\PHP\brotli
$ D:\tools\PHP\php-8.4.1-devel-vs17-x64\phpize.bat
Rebuilding configure.js
D:\tools\PHP\php-8.4.1-devel-vs17-x64
Now run 'configure --help'

D:\tools\PHP\brotli
$ configure --help
Options that enable extensions and SAPI will accept 'yes' or 'no' as a
parameter. They also accept 'shared' as a synonym for 'yes' and request a
shared build of that module. Not all modules can be built as shared modules;
configure will display [shared] after the module name if can be built that
way.

  --disable-vs-link-compat      Allow linking of libraries built with
                                compatible versions of VS toolset
  --enable-debug                Compile with debugging symbols
  --with-verbosity              Output verbosity, 0-2.
  --with-toolset                Toolset to use for the compilation, give: vs,
                                clang, icc. The only recommended and supported
                                toolset for production use is Visual Studio.
                                Use others at your own risk.
  --enable-object-out-dir       Alternate location for binary objects during
                                build
  --enable-debug                Compile with debugging symbols
  --enable-debug-pack           Release binaries with external debug symbols
                                (--enable-debug must not be specified)
  --with-prefix                 PHP installation prefix
  --with-mp                     Tell Visual Studio use up to [n,auto,disable]
                                processes for compilation
  --with-snapshot-template      Path to snapshot builder template dir
  --with-php-build              Path to where you extracted the development
                                libraries
                                (https://wiki.php.net/internals/windows/libs).
                                Assumes that it is a sibling of this source
                                dir (..\deps) if not specified
  --with-extra-includes         Extra include path to use when building
                                everything
  --with-extra-libs             Extra library path to use when linking
                                everything
  --with-codegen-arch           Architecture for code generation
  --enable-test-ini             Enable automatic php.ini generation. The
                                test.ini will be put into the build dir and
                                used to automatically load the shared
                                extensions.
  --with-test-ini-ext-exclude   Comma separated list of shared extensions to
                                be excluded from the test.ini
  --enable-native-intrinsics    Comma separated list of intrinsic
                                optimizations to enable. Available
                                optimization names are sse, sse2, sse3, ssse3,
                                sse4.1, sse4.2, avx, avx2. SSE and SSE2 are
                                enabled by default. The best optimization
                                specified will automatically enable all the
                                older optimizations. Note, that the produced
                                binary might not work properly, if the
                                optimizations are not available on the target
                                processor.

Some influential environment variables:
  CFLAGS      C compiler flags
  LDFLAGS     linker flags

D:\tools\PHP\brotli
$ configure --enable-brotli --enable-debug-pack
Saving configure options to config.nice.bat
Checking for cl.exe ...  <in default path>
  Detected compiler Visual C++ 2022
  Detected x64 compiler
Checking for link.exe ...  <in default path>
Checking for nmake.exe ...  <in default path>
Checking for lib.exe ...  <in default path>
Checking for bison.exe ...  <in default path>
  Detected bison version 3.3.2
Checking for sed.exe ...  <in default path>
Checking for re2c.exe ...  <in default path>
  Detected re2c version 1.1.1
Checking for zip.exe ...  <in default path>
Checking for lemon.exe ...  <in default path>
Checking for 7za.exe ...  <in default path>
Checking for mc.exe ...  C:\Program Files (x86)\Windows Kits\10\bin\10.0.22621.0\\x64
Checking for mt.exe ...  C:\Program Files (x86)\Windows Kits\10\bin\10.0.22621.0\\x64

Build dir: D:\tools\PHP\brotli\x64\Release
PHP Core:  php8.dll and php8.lib


Creating build dirs...
Generating files...
Generating Makefile
Generating main/config.pickle.h
Generating pickle deps
Done.



Enabled extensions:
--------------------
| Extension | Mode |
--------------------
--------------------


-----------------------------------------
|                     |                 |
-----------------------------------------
| Build type          | Release         |
| Thread Safety       | No              |
| Compiler            | Visual C++ 2022 |
| Target Architecture | x64             |
| Host Architecture   | x64             |
| Optimization        | PGO disabled    |
| Native intrinsics   | SSE2            |
| Static analyzer     | disabled        |
-----------------------------------------


WARNING
The following argument is invalid, and therefore ignored:
 --enable-brotli


Type 'nmake' to build PHP

It shows:
WARNING
The following argument is invalid, and therefore ignored:
--enable-brotli
and 'nmake' doesn't generate anything

Please help or please add .dll file for PHP 8.4 at here https://pecl.php.net/package/brotli/0.15.2/windows

Thanks

@nono303
Copy link

nono303 commented Nov 29, 2024

hi @vietgiaitri
--enable-brotli=shared works for me (see https://github.com/nono303/win-build-scripts/blob/master/modules/phpsdk-config_make.bat#L76)

  • php 8.4.1
  • php_brotli 0.15.2
...
Checking for library brotlicommon.lib;libbrotlicommon.lib ... <in deps path> \lib\brotlicommon.lib
Checking for library brotlidec.lib;libbrotlidec.lib ... <in deps path> \lib\brotlidec.lib
Checking for library brotlienc.lib;libbrotlienc.lib ... <in deps path> \lib\brotlienc.lib
Checking for brotli/encode.h ...  <in deps path> \include
Enabling extension ..\pecl\php-ext-brotli [shared]
...
Enabled extensions:
-----------------------
| Extension  | Mode   |
-----------------------
| bcmath     | shared |
| brotli     | shared |
| bz2        | shared |
...
brotli.c
   Creating library C:\sdk\src\php-sdk\phpmaster\vs17\x64\build\Release\php_brotli.lib and object C:\sdk\src\php-sdk\phpmaster\vs17\x64\build\Release\php_brotli.exp
Generating code
Finished generating code
EXT brotli build complete
...
[version] '0.15.2' C:\sdk\release\vs17_x64-avx2\_php-nts\php_brotli.dll (C:\sdk\src\php-ext-brotli\php_brotli.h)

@vietgiaitri
Copy link
Author

Hi @nono303

Sorry not too good with technology and just followed the usual instructions and didn't quite understand how to create from your instructions
Can you help me share the php_brotli.dll file for PHP NTS 8.4.1?

Thanks

@nono303
Copy link

nono303 commented Nov 29, 2024

php_brotli.zip
here is a the VS17 x64 avx2 NTS version for php 8.4.x

@vietgiaitri
Copy link
Author

@nono303
Thank you for your great support

@vietgiaitri
Copy link
Author

@nono303
This file is only 29KB, but normally it will be around a few hundred KB, so I think the version you created is corrupted and will not work.

@nono303
Copy link

nono303 commented Nov 29, 2024

I only build shared version.
It will work with vs17 x64 brotlidec.dll & brotlienc.dll in PATH
{E26B5DC8-C967-41B8-875A-8116669E3FFD}
brotlidec_brotlienc.zip

@vietgiaitri
Copy link
Author

@nono303
Maybe I understood how it works through your instructions. I will try adding those 2 .dll files to the root PHP path to test.
Thank you

@vietgiaitri
Copy link
Author

@nono303
PHP Warning: PHP Startup: Unable to load dynamic library 'php_brotli.dll'
It doesn't work

@nono303
Copy link

nono303 commented Nov 29, 2024

@vietgiaitri
Copy link
Author

vietgiaitri commented Nov 29, 2024

@nono303
I tested with memcache it works fine but brotli doesn't
Screenshot 2024-11-29 175900
Screenshot 2024-11-29 174947

@nono303
Copy link

nono303 commented Nov 29, 2024

PHP Warning: PHP Startup: Unable to load dynamic library 'php_brotli.dll'

... also require brotlicommon.dll
brotlicommon.zip

@vietgiaitri
Copy link
Author

@nono303
Great, it worked. However, I think a version that only uses one php_brotli.dll file will be more convenient for other users, so hopefully another author will fix the error I wrote in the first discussion.
Thanks

@nono303
Copy link

nono303 commented Nov 29, 2024

note: --enable-brotli=shared only means that php's brotli functions are located in a separate dll (php_brotli.dll) and not in php8.dll
If you want to have a "self-suffisant" php_brotli.dll it must be configured with --enable-brotli=shared and linked - at build time -with static brotli lib

@vietgiaitri
Copy link
Author

vietgiaitri commented Nov 29, 2024

=====================================================================
PHP         : C:\Program Files\PHP\v8.4\php.exe
Deprecated: PHP Startup: session.sid_length INI setting is deprecated in Unknown on line 0

Deprecated: PHP Startup: session.sid_bits_per_character INI setting is deprecated in Unknown on line 0

PHP_SAPI    : cli
PHP_VERSION : 8.4.1
ZEND_VERSION: 4.4.1
PHP_OS      : WINNT - Windows NT WIN-6TTM33SL82M 10.0 build 14393 (Windows Server 2016) AMD64
INI actual  : C:\Program Files\PHP\v8.4\php.ini
More .INIs  :
---------------------------------------------------------------------
PHP         : C:\Program Files\PHP\v8.4\php-cgi.exe
Deprecated: PHP Startup: session.sid_length INI setting is deprecated in Unknown on line 0

Deprecated: PHP Startup: session.sid_bits_per_character INI setting is deprecated in Unknown on line 0

PHP_SAPI    : cgi-fcgi
PHP_VERSION : 8.4.1
ZEND_VERSION: 4.4.1
PHP_OS      : WINNT - Windows NT WIN-6TTM33SL82M 10.0 build 14393 (Windows Server 2016) AMD64
INI actual  : C:\Program Files\PHP\v8.4\php.ini
More .INIs  :
---------------------------------------------------------------------
---------------------------------------------------------------------
PHP         : C:\Program Files\PHP\v8.4\phpdbg.exe
PHP_SAPI    : phpdbg
PHP_VERSION : 8.4.1
ZEND_VERSION: 4.4.1
PHP_OS      : WINNT - Windows NT WIN-6TTM33SL82M 10.0 build 14393 (Windows Server 2016) AMD64
INI actual  : C:\Program Files\PHP\v8.4\php.ini
More .INIs  :
Deprecated: PHP Startup: session.sid_length INI setting is deprecated in Unknown on line 0

Deprecated: PHP Startup: session.sid_bits_per_character INI setting is deprecated in Unknown on line 0

---------------------------------------------------------------------
CWD         : C:\Program Files\PHP\v8.4
Extra dirs  :
VALGRIND    : Not used
=====================================================================
Running selected tests.
TEST 1/28 [D:\website\test\tests\alias.phpt]
========DIFF========
001+ Deprecated: PHP Startup: session.sid_length INI setting is deprecated in Unknown on line 0
002+
003+ Deprecated: PHP Startup: session.sid_bits_per_character INI setting is deprecated in Unknown on line 0
     Compression
002- bool(true)
003- bool(true)
004- Decompression
005- bool(true)
006- bool(true)
007- ===DONE===
005+
006+ Termsig=-1073741795
========DONE========
FAIL alias (namespace) functionality [D:\website\test\tests\alias.phpt]
SKIP APCu serializer registration [D:\website\test\tests\apcu_serializer.phpt] reason: need apcu
SKIP Test compatibility [D:\website\test\tests\compatibility.phpt]
TEST 4/28 [D:\website\test\tests\compress_add.phpt]
========DIFF========
001- OK
002- ===DONE===
001+ Deprecated: PHP Startup: session.sid_length INI setting is deprecated in Unknown on line 0
002+
003+ Deprecated: PHP Startup: session.sid_bits_per_character INI setting is deprecated in Unknown on line 0
004+
005+ Termsig=-1073741795
========DONE========
FAIL Test brotli_compress_add() functionality [D:\website\test\tests\compress_add.phpt]
TEST 5/28 [D:\website\test\tests\incremental_compress_add_alias.phpt]
========DIFF========
001- ===DONE===
001+ Deprecated: PHP Startup: session.sid_length INI setting is deprecated in Unknown on line 0
002+
003+ Deprecated: PHP Startup: session.sid_bits_per_character INI setting is deprecated in Unknown on line 0
004+
005+ Termsig=-1073741795
========DONE========
FAIL Test incremental Brotli\compress_add() alias (namespace) functionality [D:\website\test\tests\incremental_compress_add_alias.phpt]
TEST 6/28 [D:\website\test\tests\incremental_compress_add_args.phpt]
========DIFF========
001- quality=0, mode=0
002- OK
003- OK
004- quality=9, mode=0
005- OK
006- OK
007- quality=11, mode=0
008- OK
009- OK
010- quality=20, mode=0
001+ Deprecated: PHP Startup: session.sid_length INI setting is deprecated in Unknown on line 0

012- Warning: brotli_compress_init(): brotli: compression level (20) must be within 0..11 in %s on line %d
013- OK
014-
015- Warning: brotli_compress_init(): brotli: compression level (20) must be within 0..11 in %s on line %d
016- OK
017- quality=-1, mode=0
018-
019- Warning: brotli_compress_init(): brotli: compression level (-1) must be within 0..11 in %s on line %d
020- OK
021-
022- Warning: brotli_compress_init(): brotli: compression level (-1) must be within 0..11 in %s on line %d
023- OK
003+ Deprecated: PHP Startup: session.sid_bits_per_character INI setting is deprecated in Unknown on line 0
     quality=0, mode=0
025- OK
026- OK
027- quality=0, mode=1
028- OK
029- OK
030- quality=0, mode=2
031- OK
032- OK
033- quality=0, mode=3

035- Warning: brotli_compress_init(): brotli: compression mode (3) must be 0, 1, 2 in %s on line %d
036- OK
037-
038- Warning: brotli_compress_init(): brotli: compression mode (3) must be 0, 1, 2 in %s on line %d
039- OK
040- quality=0, mode=-1
041-
042- Warning: brotli_compress_init(): brotli: compression mode (-1) must be 0, 1, 2 in %s on line %d
043- OK
044-
045- Warning: brotli_compress_init(): brotli: compression mode (-1) must be 0, 1, 2 in %s on line %d
046- OK
047- ===DONE===
006+ Termsig=-1073741795
========DONE========
FAIL Test incremental brotli_compress_add() functionality with arguments [D:\website\test\tests\incremental_compress_add_args.phpt]
TEST 7/28 [D:\website\test\tests\incremental_compress_add_basic.phpt]
========DIFF========
001- ===DONE===
001+ Deprecated: PHP Startup: session.sid_length INI setting is deprecated in Unknown on line 0
002+
003+ Deprecated: PHP Startup: session.sid_bits_per_character INI setting is deprecated in Unknown on line 0
004+
005+ Termsig=-1073741795
========DONE========
FAIL Test incremental brotli_compress_add() functionality [D:\website\test\tests\incremental_compress_add_basic.phpt]
TEST 8/28 [D:\website\test\tests\incremental_uncompress_add_alias.phpt]
========DIFF========
001- ===DONE===
001+ Deprecated: PHP Startup: session.sid_length INI setting is deprecated in Unknown on line 0
002+
003+ Deprecated: PHP Startup: session.sid_bits_per_character INI setting is deprecated in Unknown on line 0
004+
005+ Termsig=-1073741795
========DONE========
FAIL Test incremental Brotli\uncompress_add() alias (namespace) functionality [D:\website\test\tests\incremental_uncompress_add_alias.phpt]
TEST 9/28 [D:\website\test\tests\incremental_uncompress_add_basic.phpt]
========DIFF========
001- ===DONE===
001+ Deprecated: PHP Startup: session.sid_length INI setting is deprecated in Unknown on line 0
002+
003+ Deprecated: PHP Startup: session.sid_bits_per_character INI setting is deprecated in Unknown on line 0
004+
005+ Termsig=-1073741795
========DONE========
FAIL Test incremental brotli_uncompress_add() functionality [D:\website\test\tests\incremental_uncompress_add_basic.phpt]
PASS Test phpinfo() displays brotli info [D:\website\test\tests\info.phpt]
TEST 11/28 [D:\website\test\tests\ob_001.phpt]
========DIFF========
001- ��hi
002- �
001+ Termsig=-1073741795
========DONE========
FAIL brotli.output_compression [D:\website\test\tests\ob_001.phpt]
TEST 12/28 [D:\website\test\tests\ob_002.phpt]
========DIFF========
001+ Deprecated: PHP Startup: session.sid_length INI setting is deprecated in Unknown on line 0
002+
003+ Deprecated: PHP Startup: session.sid_bits_per_character INI setting is deprecated in Unknown on line 0
     hi
========DONE========
FAIL brotli.output_compression [D:\website\test\tests\ob_002.phpt]
TEST 13/28 [D:\website\test\tests\ob_003.phpt]
========DIFF========
001- Content-Encoding: br
002- Vary: Accept-Encoding
001+
     --HEADERS--
004- ��hi
005- �
003+ Termsig=-1073741795
========DONE========
FAIL brotli.output_compression [D:\website\test\tests\ob_003.phpt]
TEST 14/28 [D:\website\test\tests\ob_004.phpt]
========DIFF========
001- Content-Encoding: br
002- Vary: Accept-Encoding
001+
     --HEADERS--
004- ��hi
005- �
003+ Termsig=-1073741795
========DONE========
FAIL ob_brotli_handler [D:\website\test\tests\ob_004.phpt]
TEST 15/28 [D:\website\test\tests\ob_005.phpt]
========DIFF========
001+ Deprecated: PHP Startup: session.sid_bits_per_character INI setting is deprecated in Unknown on line 0
002+ Content-type: text/html; charset=UTF-8
003+
     hi
========DONE========
FAIL ob_brotli_handler [D:\website\test\tests\ob_005.phpt]
TEST 16/28 [D:\website\test\tests\ob_006.phpt]
========DIFF========
001+ Deprecated: PHP Startup: session.sid_length INI setting is deprecated in Unknown on line 0
002+
003+ Deprecated: PHP Startup: session.sid_bits_per_character INI setting is deprecated in Unknown on line 0
     ===DONE===
========DONE========
FAIL brotli.output_compression=1 with client not accepting compression [D:\website\test\tests\ob_006.phpt]
TEST 17/28 [D:\website\test\tests\ob_007.phpt]
========DIFF========
001- Vary: Cookie
002- Content-Encoding: br
003- Vary: Accept-Encoding
001+
     --HEADERS--
     %a
========DONE========
FAIL brotli.output_compression Overwrites Vary Header [D:\website\test\tests\ob_007.phpt]
TEST 18/28 [D:\website\test\tests\ob_008.phpt]
========DIFF========
001- Content-Encoding: br
002- Vary: Accept-Encoding
001+
     --HEADERS--
004- � �hi�
003+ Termsig=-1073741795
========DONE========
FAIL ob_brotli_handler always conflicts with brotli.output_compression [D:\website\test\tests\ob_008.phpt]
TEST 19/28 [D:\website\test\tests\ob_009.phpt]
========DIFF========
     %s
002+ Content-type: text/html; charset=UTF-8
003+
004+ Compressed Lengths
     array(1) {
       [0]=>
       int(%d)
--
========DONE========
FAIL checks brotli compression output size is always the same [D:\website\test\tests\ob_009.phpt]
TEST 20/28 [D:\website\test\tests\ob_010.phpt]
========DIFF========
001+ Deprecated: PHP Startup: session.sid_length INI setting is deprecated in Unknown on line 0
002+
003+ Deprecated: PHP Startup: session.sid_bits_per_character INI setting is deprecated in Unknown on line 0
     end
     DONE
========DONE========
FAIL brotli.output_compression ob_get_clean [D:\website\test\tests\ob_010.phpt]
TEST 21/28 [D:\website\test\tests\ob_011.phpt]
========DIFF========
001- Content-Encoding: br
002- Vary: Accept-Encoding
001+
     --HEADERS--
004- � ������-q ��
003+ Termsig=-1073741795
========DONE========
FAIL ob_brotli_handler [D:\website\test\tests\ob_011.phpt]
SKIP Test roundtrip [D:\website\test\tests\roundtrip.phpt]
TEST 23/28 [D:\website\test\tests\streams_001.phpt]
========DIFF========
001+ Deprecated: PHP Startup: session.sid_length INI setting is deprecated in Unknown on line 0
002+
003+ Deprecated: PHP Startup: session.sid_bits_per_character INI setting is deprecated in Unknown on line 0
     Compression with defaul level
002- bool(true)
003- int(%d)
004- bool(true)
005- Compression with specfic level
006- bool(true)
007- int(%d)
008- bool(true)
009- Decompression
010- bool(true)
011- ===DONE===
005+
006+ Termsig=-1073741795
========DONE========
FAIL compress.brotli streams basic [D:\website\test\tests\streams_001.phpt]
TEST 24/28 [D:\website\test\tests\streams_002.phpt]
========DIFF========
001+ Deprecated: PHP Startup: session.sid_length INI setting is deprecated in Unknown on line 0
002+
003+ Deprecated: PHP Startup: session.sid_bits_per_character INI setting is deprecated in Unknown on line 0
     Stream compression + brotli_uncompress
002- bool(true)
003- bool(true)
004- brotli_compress + Stream decompression
005- int(%d)
006- bool(true)
007- ===DONE===
005+
006+ Termsig=-1073741795
========DONE========
FAIL compress.brotli streams and compatibility [D:\website\test\tests\streams_002.phpt]
TEST 25/28 [D:\website\test\tests\streams_003.phpt]
========DIFF========
001+ Deprecated: PHP Startup: session.sid_length INI setting is deprecated in Unknown on line 0
002+
003+ Deprecated: PHP Startup: session.sid_bits_per_character INI setting is deprecated in Unknown on line 0
     Compress
002- bool(true)
003- int(%d)
004- int(%d)
005- bool(true)
006- Decompress
007- bool(true)
008- int(%d)
009- bool(true)
010- bool(true)
011- ===DONE===
005+
006+ Termsig=-1073741795
========DONE========
FAIL compress.brotli streams and big file [D:\website\test\tests\streams_003.phpt]
TEST 26/28 [D:\website\test\tests\streams_004.phpt]
========DIFF========
001+ Deprecated: PHP Startup: session.sid_length INI setting is deprecated in Unknown on line 0
002+
003+ Deprecated: PHP Startup: session.sid_bits_per_character INI setting is deprecated in Unknown on line 0
     Compression
002- resource(%d) of type (stream)
003- int(%d)
004- bool(true)
005- int(%d)
006- bool(true)
007- Decompression
008- bool(true)
009- ===DONE===
005+
006+ Termsig=-1073741795
========DONE========
FAIL compress.brotli streams with file functions [D:\website\test\tests\streams_004.phpt]
SKIP compress.brotli read online stream [D:\website\test\tests\streams_005.phpt] reason: online test
SKIP compress.brotli read online stream denied [D:\website\test\tests\streams_006.phpt] reason: online test
=====================================================================
Number of tests :    28                23
Tests skipped   :     5 ( 17.9%) --------
Tests warned    :     0 (  0.0%) (  0.0%)
Tests failed    :    22 ( 78.6%) ( 95.7%)
Tests passed    :     1 (  3.6%) (  4.3%)
---------------------------------------------------------------------
Time taken      : 4.935 seconds
=====================================================================

=====================================================================
FAILED TEST SUMMARY
---------------------------------------------------------------------
alias (namespace) functionality [D:\website\test\tests\alias.phpt]
Test brotli_compress_add() functionality [D:\website\test\tests\compress_add.phpt]
Test incremental Brotli\compress_add() alias (namespace) functionality [D:\website\test\tests\incremental_compress_add_alias.phpt]
Test incremental brotli_compress_add() functionality with arguments [D:\website\test\tests\incremental_compress_add_args.phpt]
Test incremental brotli_compress_add() functionality [D:\website\test\tests\incremental_compress_add_basic.phpt]
Test incremental Brotli\uncompress_add() alias (namespace) functionality [D:\website\test\tests\incremental_uncompress_add_alias.phpt]
Test incremental brotli_uncompress_add() functionality [D:\website\test\tests\incremental_uncompress_add_basic.phpt]
brotli.output_compression [D:\website\test\tests\ob_001.phpt]
brotli.output_compression [D:\website\test\tests\ob_002.phpt]
brotli.output_compression [D:\website\test\tests\ob_003.phpt]
ob_brotli_handler [D:\website\test\tests\ob_004.phpt]
ob_brotli_handler [D:\website\test\tests\ob_005.phpt]
brotli.output_compression=1 with client not accepting compression [D:\website\test\tests\ob_006.phpt]
brotli.output_compression Overwrites Vary Header [D:\website\test\tests\ob_007.phpt]
ob_brotli_handler always conflicts with brotli.output_compression [D:\website\test\tests\ob_008.phpt]
checks brotli compression output size is always the same [D:\website\test\tests\ob_009.phpt]
brotli.output_compression ob_get_clean [D:\website\test\tests\ob_010.phpt]
ob_brotli_handler [D:\website\test\tests\ob_011.phpt]
compress.brotli streams basic [D:\website\test\tests\streams_001.phpt]
compress.brotli streams and compatibility [D:\website\test\tests\streams_002.phpt]
compress.brotli streams and big file [D:\website\test\tests\streams_003.phpt]
compress.brotli streams with file functions [D:\website\test\tests\streams_004.phpt]
=====================================================================

php_info() see brotli but test failed, cannot encode and decode

Screenshot 2024-11-29 230110

Test show error 500:

$compressed = brotli_compress('Compresstest');

$uncompressed = brotli_uncompress($compressed);

echo $uncompressed;

@nono303
Copy link

nono303 commented Nov 29, 2024

{2F19BE48-F0B3-4DD3-8635-6B4531D34494}

php -r "echo brotli_uncompress(brotli_compress('Compresstest'));"
Compresstest

...my shared build chain is not made for redist
also maybe relates to Microsoft Visual C++ Redistributable if you don't have 14.42 x64 installed https://aka.ms/vs/17/release/vc_redist.x64.exe

@vietgiaitri
Copy link
Author

@nono303
Please see
Screenshot 2024-11-30 122807
How to fix?
Thanks

@nono303
Copy link

nono303 commented Nov 30, 2024

Hi @vietgiaitri
I've just quick build a static version of php_brotli. can you try it?
php_brotli-static.zip

How to fix?

  1. see in WInEventLog if some error thrown in Application tab
  2. check if missing dll dependencies with https://github.com/lucasg/Dependencies
  3. attach WinDbg to php to have full stack of failing tests

@nono303
Copy link

nono303 commented Nov 30, 2024

also, have you check that your cpu support AVX2 ? https://github.com/nono303/PHP-memcache-dll?tab=readme-ov-file#avx-avx2-or-not-sse2

@vietgiaitri
Copy link
Author

vietgiaitri commented Dec 1, 2024

@nono303
I'm not very good at technology, but before that I built the PHP NTS 8.3.x version myself and it worked normally.
Both versions of php_brotli.dll that you built for PHP 8.4.1 do not work. I also checked the CPU as shown in the picture, can you see if it could be because it cannot work? If not, why does my php_brotli.dll for version 8.3.x work?
Screenshot 2024-12-01 135339

@nono303
Copy link

nono303 commented Dec 1, 2024

Hi @vietgiaitri,
your 2010's cpu doesn't support AVX ...
here is a vs17 x64 SSE2 version statically build, could you try it?
php_brotli-vs17_x64-nts.zip

@vietgiaitri
Copy link
Author

Hi @vietgiaitri, your 2010's cpu doesn't support AVX ... here is a vs17 x64 SSE2 version statically build, could you try it? php_brotli-vs17_x64-nts.zip

@nono303
I checked, this version is working
Thank you for your enthusiastic support

@nono303
Copy link

nono303 commented Dec 1, 2024

Great!
Here is all I can build for php 8.4
php_brotli-dll_8.4.zip

filename date x link set cl pver pdb © product description
/vs16-x64-nts/avx/php-8.4.x_brotli.dll 01/12/2024 11:24 64 ltcg avx (3090) 14.29 0.15.2 OK OK php:php_brotli arch:x64-avx vcver:14.29[vs16] php:8.4.1-nts brotli:1.1.0 commit:e50bde0 tag:0.15.2 date:2024-11-08
/vs16-x64-nts/avx2/php-8.4.x_brotli.dll 01/12/2024 11:22 64 ltcg avx (3118) 14.29 0.15.2 OK OK php:php_brotli arch:x64-avx2 vcver:14.29[vs16] php:8.4.1-nts brotli:1.1.0 commit:e50bde0 tag:0.15.2 date:2024-11-08
/vs16-x64-nts/sse2/php-8.4.x_brotli.dll 01/12/2024 10:51 64 ltcg 14.29 0.15.2 OK OK php:php_brotli arch:x64 vcver:14.29[vs16] php:8.4.1-nts brotli:1.1.0 commit:e50bde0 tag:0.15.2 date:2024-11-08
/vs16-x64-ts/avx/php-8.4.x_brotli.dll 01/12/2024 10:50 64 ltcg avx (3090) 14.29 0.15.2 OK OK php:php_brotli arch:x64-avx vcver:14.29[vs16] php:8.4.1-ts brotli:1.1.0 commit:e50bde0 tag:0.15.2 date:2024-11-08
/vs16-x64-ts/avx2/php-8.4.x_brotli.dll 01/12/2024 10:48 64 ltcg avx (3118) 14.29 0.15.2 OK OK php:php_brotli arch:x64-avx2 vcver:14.29[vs16] php:8.4.1-ts brotli:1.1.0 commit:e50bde0 tag:0.15.2 date:2024-11-08
/vs16-x64-ts/sse2/php-8.4.x_brotli.dll 01/12/2024 10:52 64 ltcg 14.29 0.15.2 OK OK php:php_brotli arch:x64 vcver:14.29[vs16] php:8.4.1-ts brotli:1.1.0 commit:e50bde0 tag:0.15.2 date:2024-11-08
/vs17-x64-nts/avx/php-8.4.x_brotli.dll 01/12/2024 11:21 64 ltcg avx (3546) 14.42 0.15.2 OK OK php:php_brotli arch:x64-avx vcver:14.42[vs17] php:8.4.1-nts brotli:1.1.0 commit:e50bde0 tag:0.15.2 date:2024-11-08
/vs17-x64-nts/avx2/php-8.4.x_brotli.dll 01/12/2024 11:20 64 ltcg avx (3560) 14.42 0.15.2 OK OK php:php_brotli arch:x64-avx2 vcver:14.42[vs17] php:8.4.1-nts brotli:1.1.0 commit:e50bde0 tag:0.15.2 date:2024-11-08
/vs17-x64-nts/sse2/php-8.4.x_brotli.dll 01/12/2024 10:45 64 ltcg 14.42 0.15.2 OK OK php:php_brotli arch:x64 vcver:14.42[vs17] php:8.4.1-nts brotli:1.1.0 commit:e50bde0 tag:0.15.2 date:2024-11-08
/vs17-x64-ts/avx/php-8.4.x_brotli.dll 01/12/2024 10:44 64 ltcg avx (3546) 14.42 0.15.2 OK OK php:php_brotli arch:x64-avx vcver:14.42[vs17] php:8.4.1-ts brotli:1.1.0 commit:e50bde0 tag:0.15.2 date:2024-11-08
/vs17-x64-ts/avx2/php-8.4.x_brotli.dll 01/12/2024 10:42 64 ltcg avx (3560) 14.42 0.15.2 OK OK php:php_brotli arch:x64-avx2 vcver:14.42[vs17] php:8.4.1-ts brotli:1.1.0 commit:e50bde0 tag:0.15.2 date:2024-11-08
/vs17-x64-ts/sse2/php-8.4.x_brotli.dll 01/12/2024 10:46 64 ltcg 14.42 0.15.2 OK OK php:php_brotli arch:x64 vcver:14.42[vs17] php:8.4.1-ts brotli:1.1.0 commit:e50bde0 tag:0.15.2 date:2024-11-08

nono303 pushed a commit to nono303/win-build-scripts that referenced this issue Jan 22, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants