Category Archives: bcmath

bcmath in a shared hosting throught .htaccess

I need to use bcmath in a shared hosting that does not provide it by default. So I asked the hosting company about it and they are not going to provide it. I would have left this hosting as most of the modern hosting provide this and other features that are not provided by the current hosting. But now I just want to get the job done and not start by suggesting to my customer to leave the hosting before trying a plan B. Is it possible to get bc math in a shared hosting using .htaccess or other method? I have not been able to find anything during my search except for this http://php.net/dl, but I do not know if it applies to my case and I have not found enough information about it. This is the PHP build:

PHP Version 5.4.20 System   Linux lamp.xxx.yy
2.6.18-348.18.1.el5.centos.plus #1 SMP ... i686 
Build Date  Sep 24 2013 11:06:51
Server API  Apache 2.0 Handler
Virtual Directory Support   disabled
Additional .ini files parsed    /etc/php.d/curl.ini, /etc/php.d/dom.ini, /etc/php.d/fileinfo.ini, /etc/php.d/gd.ini, /etc/php.d/imap.ini, /etc/php.d/ioncube-loader.ini, /etc/php.d/json.ini, /etc/php.d/ldap.ini, /etc/php.d/mbstring.ini, /etc/php.d/mysql.ini, /etc/php.d/mysqli.ini, /etc/php.d/pdo.ini, /etc/php.d/pdo_mysql.ini, /etc/php.d/pdo_sqlite.ini, /etc/php.d/phar.ini, /etc/php.d/wddx.ini, /etc/php.d/xcache.ini, /etc/php.d/xmlreader.ini, /etc/php.d/xmlwriter.ini, /etc/php.d/xsl.ini, /etc/php.d/zip.ini
PHP API     20100412
PHP Extension   20100525
Zend Extension  220100525
Zend Extension Build    API220100525,NTS
PHP Extension Build     API20100525,NTS
Debug Build     no
Thread Safety   disabled
Zend Signal Handling    disabled
Zend Memory Manager     enabled
Zend Multibyte Support  provided by mbstring
IPv6 Support    enabled
DTrace Support  disabled
Registered PHP Streams  https, ftps, compress.zlib, compress.bzip2, php, file, glob, data, http, ftp, phar, zip
Registered Stream Socket Transports tcp, udp, unix, udg, ssl, sslv3, sslv2, tls
Registered Stream Filters   zlib.*, bzip2.*, convert.iconv.*, string.rot13, string.toupper, string.tolower, string.strip_tags, convert.*, consumed, dechunk

CentOS 6.5 – PHP 5.6.7 and bcmath

I am trying to install php-bcmath on CentOS 6.5 and my current PHP Version is 5.6.7. The reason why I'm trying to install this is because I have a plugin for my forum which I am using that throws off errors due to my server using the most recent PHP version. The error it's throwing is listed below:

Flags/Listener/Includes/Reader/Decoder.php on line 258, referer: http://IP Address/admin.php

[Tue Apr 07 03:42:15 2015] [error] [client IP Address] PHP Fatal error: Call to undefined function Countryflags\Db\Reader\bcadd() in /var/www/html/library/Snog/CountryFlags/Listener/Includes/Reader/Decoder.php on line 258, referer: http://IP Address/admin.php

[Tue Apr 07 03:45:50 2015] [error] [client IP Address] PHP Fatal error: Call to undefined function Countryflags\Db\Reader\bcadd() in /var/www/html/library/Snog/CountryFlags/Listener/Includes/Reader/Decoder.php on line 258

[Tue Apr 07 03:45:56 2015] [error] [client IP Address] PHP Fatal error: Call to undefined function Countryflags\Db\Reader\bcadd() in /var/www/html/library/Snog/CountryFlags/Listener/Includes/Reader/Decoder.php on line 258

So when I try installing php-bcmath on my server via yum install, I get:

[[email protected] logs]# yum install php-bcmath Loaded plugins:
fastestmirror, replace Loading mirror speeds from cached hostfile
* base: mirror-centos.hostingswift.com
* extras: mirror.oss.ou.edu
* updates: mirror.team-cymru.org
* webtatic: us-east.repo.webtatic.com Setting up Install Process Resolving Dependencies
--> Running transaction check
---> Package php-bcmath.x86_64 0:5.3.3-40.el6_6 will be installed
--> Processing Dependency: php-common(x86-64) = 5.3.3-40.el6_6 for package: php-bcmath-5.3.3-40.el6_6.x86_64
--> Running transaction check
---> Package php-common.x86_64 0:5.3.3-40.el6_6 will be installed
--> Processing Conflict: php56w-common-5.6.7-1.w6.x86_64 conflicts php-common 5.5.0
--> Finished Dependency Resolution Error: php56w-common conflicts with php-common-5.3.3-40.el6_6.x86_64 You could try using --skip-broken to work around the problem You could try running: rpm -Va --nofiles
--nodigest [[email protected] logs]#

Are there any ways to get the installation working properly?

Thanks!