Bcsub undefined with php 5.2.2

software development

#1

I’m using php 5.2.2 in my domain through the automagic dreamhost stuff (not my own version) and I’m getting an undefined function error on bcsub, but it should be bundled into the language as of 4.0.4.

Am I missing something?


#2

[quote]bcsub

The bcsub function is a part of the BCMath Binary Calculator and, by default,default Dreamhost PHP installations do not enable the bcmath module. While the libbcmath library is bundled with PHP (since PHP 4.0.4), these functions are only available if PHP was configured with --enable-bcmath, and DreamHost default installations of PHP are no configured that way.

DH does not install custom PHP configurations for customers’ use so, if you want to enable the bcmath module, you will need to do it yourself or find someone to do it for you.

DreamHost allows you to install your own version of PHP, and you may certianly enable the bcmath module in such an installation if you choose to do so.

You can learn more about enabling the bcmath module at:

http://us.php.net/manual/en/ref.bc.php

Here are several DH wiki pages that can help you understand how to do this in the DreamHost environment:

http://wiki.dreamhost.com/Advanced_PHP_configuration
http://wiki.dreamhost.com/Installing_PHP5
http://wiki.dreamhost.com/PHP.ini
http://wiki.dreamhost.com/Custom_PHP.ini

If this is not something you feel comfortable attempting yourself, you might find someone else to do it for you; I know Mousee has indicated he does such things.

–rlparker


#3

[quote]
If this is not something you feel comfortable attempting yourself, you might find someone else to do it for you; I know Mousee has indicated he does such things.[/quote]
Just really busy lately :stuck_out_tongue: (but happy to help of course!)

I can’t imagine enabling the bcmath module is too complicated though. If you can’t figure it out right away, just post back and I’ll show you (here) which code to alter. :wink:


Chips N Cheese - Custom PHP installs and the like!


#4

If I can enable it without installing my own copy of php, that’d be cool. Otherwise, it seems like overkill to get one function.


#5

Unfortunately, it will require your own installation of PHP to enable the many bcmath functions. If enabled, all the other bcmath functions become available, in addition to the “one function” your applications is using.

–rlparker