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

Call to undefined function bcmod() while calling tests.php #133

Open
cmellwig opened this issue Dec 28, 2023 · 6 comments
Open

Call to undefined function bcmod() while calling tests.php #133

cmellwig opened this issue Dec 28, 2023 · 6 comments

Comments

@cmellwig
Copy link

When calling tests I get a 500 Error Call to undefined function bcmod()

Tested with v5.2.1 on Admidio 4.2.14 (official docker image)

[Thu Dec 28 04:35:28.032099 2023] [php:error] [pid 62540] [client 172.20.0.4:46404] PHP Fatal error: Uncaught Error: Call to undefined function bcmod() in /opt/app-root/src/adm_plugins/membership_fee/common_function.php:1145\nStack trace:\n#0 /opt/app-root/src/adm_plugins/membership_fee/common_function.php(1100): test_iban('dexxxxxxxxxxxx...')\n#1 /opt/app-root/src/adm_plugins/membership_fee/tests.php(97): check_iban()\n#2 {main}\n thrown in /opt/app-root/src/adm_plugins/membership_fee/common_function.php on line 1145, referer: https://admidio.domain.tdl/adm_plugins/membership_fee/membership_fee.php

@rmbinder
Copy link
Owner

It looks like your docker is missing the PHP extension bcmath. But I can't help here because I don't know much about docker.
You could temporarily deactivate the IBAN test. To do this, uncheck “Test ‘IBAN test’ activate” in Preferences - Tests.

@baloo66
Copy link

baloo66 commented Mar 23, 2024

@rmbinder - maybe i can help. what help is wanted?

@cmellwig - does the problem still exist? is it - as rmbinder mentioned - a docker container? did you build it by youself? do you have access to Dockerfile?

@rmbinder
Copy link
Owner

Like I said, I don't know much about Docker. Is it possible that the PHP extension bcmath is missing from the official Docker image?

I haven't received any other messages yet that bcmod is not defined.

@cmellwig
Copy link
Author

It's the official admidio docker container. So it's very possible that the extension is missing. I'd have to check with the latest version. Are there any downsides in including the extension by default? If not a pullrequest for admidio would be more appropriate. Sorry for late reply, very busy currently

@baloo66
Copy link

baloo66 commented Mar 25, 2024

I see - ok, so the current admidio Docker image (more precisely: Docker images created after February 12, 2024) should contain bcmath. After switching from php:apache-bullseye to vanilla Ubuntu as the base image, the modules (and thus also php-bcmath) are installed explicitly during image creation.
I think with a recent Docker image (>= 4.3.4) it should work.. But: I'll try it out as soon as I get home and then write again.

@baloo66
Copy link

baloo66 commented Mar 29, 2024

@cmellwig : tried it at home with admidio/admidio:v4.3.4 (and v4.3.6) - there is bcmath included (php 8.1.2 and bcmath extension is installed). So it should work (a quick php --re bcmath shows funcion bcmod is present).
Hope this info helps. If you are stuck with your version of the docker image, you can easyly build a specialised version and add bcmath by yourself (requires a Dockerfile and a build step). If you want to go that way, feel free to write again (but I recommend staying at the releas train of admidio instead)...

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

3 participants