|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2021-02-24 12:02 UTC] php4fan at gmail dot com
Description: ------------ --- From manual page: https://php.net/bc.installation --- It says: "These functions are only available if PHP was configured with --enable-bcmath." So, I look at the output of phpinfo() on a particular installation of phpfpm 7.4 that is throwing "call to undefined function bcpow()" errors and I find: Configure Command: [.....] '--enable-bcmath=shared' [.....] So, that's confusing. There is a --enable-bcmath flag, yet the bc math functions are not available, and there is no "BC Math" section in phpinfo(). I guess I need to understand what "shared" means. For starters, I would expect to find more information at https://www.php.net/manual/en/bc.installation.php but there's nothing there. "These functions are only available if PHP was configured with --enable-bcmath. The Windows version of PHP has built-in support for this extension. You do not need to load any additional extensions in order to use these functions." The sentence "You do not need to load any additional extensions in order to use these functions" seems to refer only to Windows. What about linux? Do I need to load additional extensions there? So I think: let's look at the documentation about the "--enable-bcmath" configure flag. Maybe it explains what the value "shared" means. Perhaps it means that it allows to enable bcmath as a shared library-or-something, maybe an extension that can be loaded at runtime without recompiling. I don't know, let's look. So I found this: https://www.php.net/manual/en/configure.about.php "List of configure options". It's not listed there. It says: "Below is a partial list of configure options [...] Most configure options are listed in their appropriate locations on the extension reference pages and not here" Ok, so where is the "appropriate location on the extension reference pages"?? To me it looks like it should be here: https://php.net/bc.installation But again, nothing there. PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Mon Dec 22 00:00:02 2025 UTC |
"These functions are only available if PHP was configured with --enable-bcmath." ...when you manage your PHP installation yourself. The Linux world does something else (ie, "These functions are only available if the bcmath extension was installed with apt/yum/etc.") and the Windows world mostly does something else ("...if the bcmath extension is enabled/uncommented in php.ini.") and the shared hosting world does yet another thing ("...if the bcmath extension was installed by your hosting provider." or perhaps "...if the bcmath extension was enabled in cPanel.") The problem is that there are very many ways to set up PHP and its extensions and trying to cover them all in the official docs is an unreasonable burden, but what we can do is cover the fundamental for-people-who-manage-PHP-installations instructions. Do you have any suggestions for how to describe the various different ways PHP can be set up? Because this is not just about bcmath but about virtually *every* extension - even the so-called "core" ones that the docs say are included will sometimes be *removed* and bundled separately (eg, json).