1

I am trying to "compile" a php file with bambalam that uses the BCMATH library, which is built into PHP as of a while ago. When I "compile" the file, the function "bcpowmod" errors on runtime. I manually downloaded the php_bcmath.dll and included it in the compilation, but I still get an error..this time stating the DLL cannot be loaded from memory. Does anyone have any experience with this? I am at a complete loss. I am also open to other compiler suggestions....

C:\xampp\htdocs\proc>c:\Users\Mike\Desktop\bamcompile.exe -e:php_bcmath.dll test.php test.exe

Bambalam PHP EXE Compiler/Embedder 1.21

Mainfile: test.php
Outfile: test.exe

Encoding and embedding test.php
Embedding php_bcmath.dll and adding it to extension loader

test.exe created successfully!

C:\xampp\htdocs\proc>test.exe

**Warning: dl_memory(): Unable to load dynamic library 'PHP_BCMATH.DLL' - The specified module could not be found.in bambalam_init.php on line 1**

Fatal error: Call to undefined function:  bcpowmod() in C:\xampp\htdocs\proc\Mat
h\BigInteger.php on line 1700

C:\xampp\htdocs\proc>
Raptor
  • 53,206
  • 45
  • 230
  • 366
Mike
  • 23
  • 3
  • check `phpinfo()` to see whether BC MATH is enabled in PHP – Raptor May 09 '14 at 03:25
  • it is....works fine when I run it with the native PHP installation on my machine. I know bambalam comes with a bcmath lib...not sure why it would be missing a function... – Mike May 09 '14 at 03:40
  • Another chance of missing this function is, your PHP version is < 5. Read this: http://www.php.net/manual/en/function.bcpowmod.php – Raptor May 09 '14 at 04:19
  • 1
    Bambalam uses < 5. I used one of the replacement functions. Thank you! – Mike May 09 '14 at 11:10

1 Answers1

0

As mentioned in comment, the function bcpowmod() is not available before PHP 5. Therefore replacement function has to be used, which is available here.

Raptor
  • 53,206
  • 45
  • 230
  • 366