ext-decimal
ext-decimal copied to clipboard
Support of PHP 8.2 for Windows
Hello!
When did you plan to release build of extension for newly release of PHP 8.2 for Windows?
+1 i downloaded dll file from pecl but it seems to have a problem with php 8.2 PHP Startup: decimal: Unable to initialize module
I have build it myself. These are the steps I noted:
Build php-decimal extension on windows
Based on https://wiki.php.net/internals/windows/stepbystepbuild_sdk_2 and PHP 8.2.
- Install the Visual Studio Build Tool 2019. You will only need a single component:
- MSVC v142 - VS 2019 C++ x64/x86 build tools (latest)
- Download the extension source from pecl: https://pecl.php.net/get/decimal-1.4.0.tgz (can be found on PECL :: Package :: decimal (php.net))
- Follow the instructions under "Building PECL extensions with phpize" under under PHP: internals:windows:stepbystepbuild_sdk_2
- Make sure to run the steps in the developer console for visual studio 2019
- Make sure to use
--with-decimal
instead of--enable-decimal
- Make sure to have the libmpdec sources somewhere on your system and provide it as extra includes and libs
- As reference, my final configure command:
configure --with-extra-includes=D:\php\libmpdec-2.4.2-vc15-x64\include --with-extra-libs=D:\php\libmpdec-2.4.2-vc15-x64\lib --disable-all --with-decimal
- Copy the generated dll in
x64\Release
to your PHP installationsext
folder and enable it in thephp.ini
. Also make sure to placelibmpdec.dll
in the PHP installation root dir. - That's it!
Sources:
- php-devel-pack-8.2.6-nts-Win32-vs16-x64.zip - source: PHP For Windows: Binaries and sources Releases
- libmpdec-2.4.2-vc15-x64.zip -source: windows.php.net - /downloads/pecl/deps/
@bobvandevijver Nice work.
Just a tiny remark. If you do not put libmpdec.lib
in your libs directory the build will use libmpdec_a.lib
, which is the static library. Then you do not need libmpdec.dll
in your PHP root directory. And the extension does not have any dependencies at all. I always prefer to build with the static libraries if a dependent dll is used in only 1 extension.
@Jan-E Thanks for the addition! Did not know about that, already took me quite some to get it working due to the undocumented with-decimal
instead of the expected enable-decimal
to be honest 😅.
Just tried your suggestion, works like a charm. I agree with you that in this case a static library is more suitable.
If anybody needs it (and trusts my build), you can download it here for NTS x64: php_decimal.zip. This is the version with the library statically linked, so no need for the libmpdec
.
The difference between —with-extension and —enable-extension is always a bit arbitrary. —with-extension is often used with an argument, for instance a path to a dependency. I might give shot at changing the config.w32. It would be better if it defaults to the static library if it finds libmpdec_a.lib
.
See https://www.apachelounge.com/viewtopic.php?t=6359 The 64 bits PHP 8.2.7 contains php_decimal.dll now. And some other extensions: https://phpdev.toolsforresearch.com/php-8.2.7-nts-Win32-vs16-x64.htm
The 8.2.7 TS PHP is still compiling, but will be uploaded with php_decimal.php as well soon.
I was not aware that this extension existed, but browsed a bit around when @rtheunissen had merged a PR for the DS extension: https://github.com/php-ds/ext-ds/pull/195#event-9560572375
Hey guys, thank you for this work. I'll create a new release for us. I am traveling at the moment but will be home later this week. I'll do the same for the other extensions too. I really want 2.0 released for this library, it's been ready for years now.
@rtheunissen Before releasing 2.0 please review and merge https://github.com/php-decimal/ext-decimal/pull/73
any update 2.0.0 :(
Hi,
I Have build this extension for Windows. You can get the build here: https://phpext.phptools.online/extension/math/decimal-144
@pandureynaldo, I don't build the 2.0 version because it's an alpha version and older than 1.5.0. You can request a build for the 2.0 version if you want I try to build it. https://phpext.phptools.online/extension/math/decimal-144
Please consider support to help me to maintain this service. https://www.paypal.com/donate/?hosted_button_id=PV3Q72NSPYQQ4
I think I just need to release 2.0 properly.