By TWD on
Trying to run this code on a local dev site.
$minutes_gcd = gcd($minutes, 60);
but I am only seeing this
Fatal error: Call to undefined function gcd() in C:\AcquiaSites\sites\all\modules\custom\d7dev\d7dev.module on line 31
Other PHP built in functions seem to work fine.
Is there something missing from the php.ini file possibly?
Comments
http://www.php.net/manual/en/
http://www.php.net/manual/en/gmp.installation.php
you may need to install the extention on your server, or ask your hosts to do it
RTFM!
For further support or projects contact me.
Source Control - Web Design, Development and Hosting Oxfordshire, UK
It is not a built in
It is not a built in function as far as I can see though this is: http://php.net/manual/en/function.gmp-gcd.php there is an example of defining it here http://php.net/manual/en/ref.math.php
Digit Professionals specialising in Drupal, WordPress & CiviCRM support for publishers in non-profit and related sectors
Have a look at the
Have a look at the installation page i linked, it lists what should be in php.ini if its there by default, if not, you can use that link to download and install it.
RTFM!
For further support or projects contact me.
Source Control - Web Design, Development and Hosting Oxfordshire, UK
gcd
Try to replace the above line with this code
$minutes_gcd = gmp_strval(gmp_gcd($minutes, "60"));
Thanks! This totally solved
Thanks! This totally solved my same problem.