Posts Tagged ‘How to fix PHP “Fatal error: Call to undefined function bcmod()” and “Fatal error: Call to undefined function bcdiv()” on FreeBSD’

How to fix PHP “Fatal error: Call to undefined function bcmod()” and “Fatal error: Call to undefined function bcdiv()” on FreeBSD

Thursday, March 17th, 2011

After some php updates on my 7.2-RELEASE-p4, my lessnmore suddenly stopped working with the following error messages:

Fatal error: Call to undefined function bcmod()
Fatal error: Call to undefined function bcdiv()

A bit of investigation has led me to the root of the problem which was a missing php5-bcmath php extension to solve the error messages and get back my lessnmore shortener to normal I had to issue:

freebsd# cd /usr/ports/math/php52-bcmath
freebsd# make install clean
Hooray it works all now again, Hallelujah!