I'm getting the following error while installing one of a joomla component.
Function : bcmod is not available. Please ask your hosts how you can enable this function in your PHP installation.
you need your PHP to be compiled with bcmath support (--enable-bcmath configure option). If you're on shared hosting it is unlikely they will enable it for you. So you can try a solution from PHP manual from this page: http://ru.php.net/manual/en/function.bcmod.php I haven't tried it , but you can test it:
/**
* my_bcmod - get modulus (substitute for bcmod)
* string my_bcmod ( string left_operand, int modulus )
* left_operand can be really big, but be carefull with modulus :(
* by Andrius Baranauskas and Laurynas Butkus :) Vilnius, Lithuania
**/
function my_bcmod( $x, $y )
{
// how many numbers to take at once? carefull not to exceed (int)
$take = 5;
$mod = '';
do
{
$a = (int)$mod.substr( $x, 0, $take );
$x = substr( $x, $take );
$mod = $a % $y;
}
while ( strlen($x) );
return (int)$mod;
}
// example
echo my_bcmod( "7044060001970316212900", 150 );
If you have a dedicated server, try the solution given here https://stackoverflow.com/a/25229386/8015825.
Before recompiling, check the php.ini file and search for "bcmath". You may find bcmath.scale=0. If so, change the 0 to a 2.
And then restart your http server
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With