• If you are still using CentOS 7.9, it's time to convert to Alma 8 with the free centos2alma tool by Plesk or Plesk Migrator. Please let us know your experiences or concerns in this thread:
    CentOS2Alma discussion

Need help enabling BCmath php module

nlouks

New Pleskian
Hi, I've been going round in circles for the past 24 hours trying to figure out how to enable bcmath in php.

We have a virtual server running Linux CentOS 6 with plesk 11.5 & PHP 5.4.28

So far I have found info here: http://pkgs.org/centos-6/remi-x86_64/php-bcmath-5.4.28-1.el6.remi.x86_64.rpm.html

But can't get the commands to work. I'm not great with putty and the commands but learning a little.

I was also hoping that maybe updating PHP to a newer version and using the --enable-bcmath would work but I have no idea where to start.

We have several websites installed on the server, some with opencart etc installed so I don't want to break the server!

Any help would be greatly appreciated as I'm going to have no hair left at this rate!

This is what I get so far:

[root@louks ~]# wget rpms.famillecollet.com/enterprise/6/remi/x86_64/php-bcmath-5.4.28-1.el6.remi.x86_64.rpm
--2014-05-20 11:27:10-- http://rpms.famillecollet.com/enterprise/6/remi/x86_64/php-bcmath-5.4.28-1.el6.remi.x86_64.rpm
Resolving rpms.famillecollet.com... 195.154.241.117, 2001:bc8:33a1:100::1
Connecting to rpms.famillecollet.com|195.154.241.117|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 61340 (60K) [application/x-rpm]
Saving to: `php-bcmath-5.4.28-1.el6.remi.x86_64.rpm'

100%[======================================>] 61,340 --.-K/s in 0.01s

2014-05-20 11:27:10 (4.31 MB/s) - `php-bcmath-5.4.28-1.el6.remi.x86_64.rpm' saved [61340/61340]

[root@louks ~]# rpm -Uvh php-bcmath-5.4.28-1.el6.remi.x86_64.rpm
warning: php-bcmath-5.4.28-1.el6.remi.x86_64.rpm: Header V3 DSA/SHA1 Signature, key ID 00f97f56: NOKEY
error: Failed dependencies:
php-common(x86-64) = 5.4.28-1.el6.remi is needed by php-bcmath-5.4.28-1.el6.remi.x86_64

[root@louks ~]# rpm -Uvh php-bcmath-5.4.28-1.el6.remi.x86_64*rpm
warning: php-bcmath-5.4.28-1.el6.remi.x86_64.rpm: Header V3 DSA/SHA1 Signature, key ID 00f97f56: NOKEY
error: Failed dependencies:
php-common(x86-64) = 5.4.28-1.el6.remi is needed by php-bcmath-5.4.28-1.el6.remi.x86_64

Sorry for the long post.
 
Hi Henning, that's a good idea. I'll follow the instructions on the link you gave me. I take it that once its installed, you can just select the php version within the hosting for each site?
 
Hi again.

in putty at the min. used wget and the phpversion to get the install file on the server.
Then unpacked it to a folder, went into the folder created and used ./configure (with a bunch of stuff on the web page you gave as I have no idea which to enable and which not too) which did include --enable-bcmath.

Pressed enter and it went scrolling down the page until it hit this:

checking whether to enable LIBXML support... yes
checking libxml2 install dir... /usr/local/php5328-cgi
checking for xml2-config path...
configure: error: xml2-config not found. Please check your libxml2 installation.

So now I'm stuck. Did everything go right or do I need to sort something to do with this libxml2?

Thank you again!
 
Hi nlouks,

try installing libxml2 and libxml2-devel through yum.

Sorry Henning I have no idea how to do that, I can only follow instructions as I don't know what I'm doing.

Just checked the /configure text and this is what I put:

./configure '--with-libdir=lib64' '--cache-file=../config.cache' '--prefix=/usr/local/php5328-cgi' '--with-config-file-path=/usr/local/php5328-cgi/etc' '--disable-debug' '--with-pic' '--disable-rpath' '--enable-fastcgi' '--with-bz2' '--with-curl' '--with-freetype-dir=/usr/local/php5328-cgi' '--with-png-dir=/usr/local/php5328-cgi' '--enable-gd-native-ttf' '--without-gdbm' '--with-gettext' '--with-gmp' '--with-iconv' '--with-jpeg-dir=/usr/local/php5328-cgi' '--with-openssl' '--with-pspell' '--with-pcre-regex' '--with-zlib' '--enable-exif' '--enable-ftp' '--enable-sockets' '--enable-sysvsem' '--enable-sysvshm' '--enable-sysvmsg' '--enable-wddx' '--with-kerberos' '--with-unixODBC=/usr' '--enable-shmop' '--enable-calendar' '--without-sqlite3' '--with-libxml-dir=/usr/local/php5328-cgi' '--enable-pcntl' '--with-imap' '--with-imap-ssl' '--enable-mbstring' '--enable-mbregex' '--with-gd' '--enable-bcmath' '--with-xmlrpc' '--with-ldap' '--with-ldap-sasl' '--with-mysql=/usr' '--with-mysqli' '--with-snmp' '--enable-soap' '--with-xsl' '--enable-xmlreader' '--enable-xmlwriter' '--enable-pdo' '--with-pdo-mysql' '--with-pdo-pgsql' '--with-pear=/usr/local/php5328-cgi/pear' '--with-mcrypt' '--enable-intl' '--without-pdo-sqlite' '--with-config-file-scan-dir=/usr/local/php5328-cgi/php.d'

should I just take out the '--with-libxml-dir=/usr/local/php540-cgi' and try it again? Can I try it again or do I need to start from scratch?

Thanks again.
 
Do I even need all that stuff? I just want '--enable-bcmath' and probably the prefix bit I think so it doesnt mess up the other php versions
 
Dear nlouks,

to configure and make a new version of PHP it is required to install specific modules, i.e. libxml2.
Try running the following command, without the quotes:

"yum install libxml2 libxml2-devel"

Afterwards try running your configure command.
 
Okay, did that. Got this:

[root@louks php-5.3.28]# yum install libxml2 libxml2-devel
Loaded plugins: fastestmirror, priorities, security
Loading mirror speeds from cached hostfile
* atomic: mir01.syntis.net
* base: mirror.sov.uk.goscomb.net
* extras: centos.serverspace.co.uk
* updates: centosh2.centos.org
atomic | 3.4 kB 00:00
base | 3.7 kB 00:00
extras | 3.4 kB 00:00
updates | 3.4 kB 00:00
http://centosh2.centos.org/centos/6...784827f632c1939c87ffdd7c3-primary.sqlite.bz2: [Errno 12] Timeout on http://centosh2.centos.org/centos/6...784827f632c1939c87ffdd7c3-primary.sqlite.bz2: (28, 'Operation too slow. Less than 1 bytes/sec transfered the last 30 seconds')
Trying other mirror.
updates/primary_db | 3.1 MB 00:00
181 packages excluded due to repository priority protections
Setting up Install Process
Resolving Dependencies
--> Running transaction check
---> Package libxml2.x86_64 0:2.7.6-14.el6 will be updated
---> Package libxml2.x86_64 0:2.7.6-14.el6_5.1 will be an update
---> Package libxml2-devel.x86_64 0:2.7.6-14.el6_5.1 will be installed
--> Processing Dependency: zlib-devel for package: libxml2-devel-2.7.6-14.el6_5.1.x86_64
--> Running transaction check
---> Package zlib-devel.x86_64 0:1.2.3-29.el6 will be installed
--> Finished Dependency Resolution
Error: Multilib version problems found. This often means that the root
cause is something else and multilib version checking is just
pointing out that there is a problem. Eg.:

1. You have an upgrade for libxml2 which is missing some
dependency that another package requires. Yum is trying to
solve this by installing an older version of libxml2 of the
different architecture. If you exclude the bad architecture
yum will tell you what the root cause is (which package
requires what). You can try redoing the upgrade with
--exclude libxml2.otherarch ... this should give you an error
message showing the root cause of the problem.

2. You have multiple architectures of libxml2 installed, but
yum can only see an upgrade for one of those arcitectures.
If you don't want/need both architectures anymore then you
can remove the one with the missing update and everything
will work.

3. You have duplicate versions of libxml2 installed already.
You can use "yum check" to get yum show these errors.

...you can also use --setopt=protected_multilib=false to remove
this checking, however this is almost never the correct thing to
do as something else is very likely to go wrong (often causing
much more problems).

Protected multilib versions: libxml2-2.7.6-14.el6_5.1.x86_64 != libxml2-2.7.6-14.el6.i686
You could try using --skip-broken to work around the problem
You could try running: rpm -Va --nofiles --nodigest
[root@louks php-5.3.28]#
 
Sear nlouks,

that sounds a little bit more complicated.
Please try the following commands:

1.) "yum upgrade"
2.) "yum update"
3.) "yum update libxml2"
4.) "yum install libxml2-devel"

Please provide me any output please.
 
Sear nlouks,

that sounds a little bit more complicated.
Please try the following commands:

1.) "yum upgrade"
2.) "yum update"
3.) "yum update libxml2"
4.) "yum install libxml2-devel"

Please provide me any output please.

Did the yum upgrade one but accidentally knocked the keyboard but I think its okay.

Here's what happened:

Package Arch Version Repository Size
================================================================================
Updating:
libxml2 i686 2.7.6-14.el6_5.1 updates 800 k
libxml2 x86_64 2.7.6-14.el6_5.1 updates 800 k
libxml2-python x86_64 2.7.6-14.el6_5.1 updates 321 k
tzdata noarch 2014b-3.24.el6 updates 452 k
tzdata-java noarch 2014b-3.24.el6 updates 148 k

Transaction Summary
================================================================================
Upgrade 5 Package(s)

Total download size: 2.5 M
Is this ok [y/N]: y
Downloading Packages:
^C(1/5): libxml2-2.7.6-1 (4%) 14% [=- ] 756 B/s | 113 kB 15:31 ETA
Current download cancelled, interrupt (ctrl-c) again within two seconds
to exit.

(1/5): libxml2-2.7.6-14.el6_5.1.i686.rpm | 800 kB 00:00
(2/5): libxml2-2.7.6-14.el6_5.1.x86_64.rpm | 800 kB 00:00
(3/5): libxml2-python-2.7.6-14.el6_5.1.x86_64.rpm | 321 kB 00:00
(4/5): tzdata-2014b-3.24.el6.noarch.rpm | 452 kB 00:00
(5/5): tzdata-java-2014b-3.24.el6.noarch.rpm | 148 kB 00:00
--------------------------------------------------------------------------------
Total 37 kB/s | 2.5 MB 01:08
Running rpm_check_debug
Running Transaction Test
Transaction Test Succeeded
Running Transaction
Updating : libxml2-2.7.6-14.el6_5.1.x86_64 1/10
Updating : libxml2-python-2.7.6-14.el6_5.1.x86_64 2/10
Updating : tzdata-2014b-3.24.el6.noarch 3/10
Updating : tzdata-java-2014b-3.24.el6.noarch 4/10
Updating : libxml2-2.7.6-14.el6_5.1.i686 5/10
Cleanup : libxml2-2.7.6-14.el6 6/10
Cleanup : tzdata-2014b-1.el6.noarch 7/10
Cleanup : tzdata-java-2014b-1.el6.noarch 8/10
Cleanup : libxml2-python-2.7.6-14.el6.x86_64 9/10
Cleanup : libxml2-2.7.6-14.el6 10/10
Verifying : libxml2-2.7.6-14.el6_5.1.x86_64 1/10
Verifying : tzdata-java-2014b-3.24.el6.noarch 2/10
Verifying : tzdata-2014b-3.24.el6.noarch 3/10
Verifying : libxml2-2.7.6-14.el6_5.1.i686 4/10
Verifying : libxml2-python-2.7.6-14.el6_5.1.x86_64 5/10
Verifying : tzdata-2014b-1.el6.noarch 6/10
Verifying : libxml2-2.7.6-14.el6.i686 7/10
Verifying : libxml2-python-2.7.6-14.el6.x86_64 8/10
Verifying : tzdata-java-2014b-1.el6.noarch 9/10
Verifying : libxml2-2.7.6-14.el6.x86_64 10/10

Updated:
libxml2.i686 0:2.7.6-14.el6_5.1 libxml2.x86_64 0:2.7.6-14.el6_5.1
libxml2-python.x86_64 0:2.7.6-14.el6_5.1 tzdata.noarch 0:2014b-3.24.el6
tzdata-java.noarch 0:2014b-3.24.el6

Complete!
[root@louks php-5.3.28]# yum upgrade
Loaded plugins: fastestmirror, priorities, security
Loading mirror speeds from cached hostfile
* atomic: mir01.syntis.net
* base: mirror.sov.uk.goscomb.net
* extras: centos.serverspace.co.uk
* updates: centosh2.centos.org
181 packages excluded due to repository priority protections
Setting up Upgrade Process
No Packages marked for Update
[root@louks php-5.3.28]# yum update
Loaded plugins: fastestmirror, priorities, security
Loading mirror speeds from cached hostfile
* atomic: mir01.syntis.net
* base: mirror.sov.uk.goscomb.net
* extras: centos.serverspace.co.uk
* updates: centosh2.centos.org
181 packages excluded due to repository priority protections
Setting up Update Process
No Packages marked for Update
[root@louks php-5.3.28]# yum upgrade
Loaded plugins: fastestmirror, priorities, security
Loading mirror speeds from cached hostfile
* atomic: mir01.syntis.net
* base: mirror.sov.uk.goscomb.net
* extras: centos.serverspace.co.uk
* updates: centosh2.centos.org
181 packages excluded due to repository priority protections
Setting up Upgrade Process
No Packages marked for Update
[root@louks php-5.3.28]# yum update libxml2
Loaded plugins: fastestmirror, priorities, security
Loading mirror speeds from cached hostfile
* atomic: mir01.syntis.net
* base: mirror.sov.uk.goscomb.net
* extras: centos.serverspace.co.uk
* updates: centosh2.centos.org
181 packages excluded due to repository priority protections
Setting up Update Process
No Packages marked for Update
[root@louks php-5.3.28]# yum install libxml2-devel
Loaded plugins: fastestmirror, priorities, security
Loading mirror speeds from cached hostfile
* atomic: mir01.syntis.net
* base: mirror.sov.uk.goscomb.net
* extras: centos.serverspace.co.uk
* updates: centosh2.centos.org
181 packages excluded due to repository priority protections
Setting up Install Process
Resolving Dependencies
--> Running transaction check
---> Package libxml2-devel.x86_64 0:2.7.6-14.el6_5.1 will be installed
--> Processing Dependency: zlib-devel for package: libxml2-devel-2.7.6-14.el6_5.1.x86_64
--> Running transaction check
---> Package zlib-devel.x86_64 0:1.2.3-29.el6 will be installed
--> Finished Dependency Resolution

Dependencies Resolved

================================================================================
Package Arch Version Repository Size
================================================================================
Installing:
libxml2-devel x86_64 2.7.6-14.el6_5.1 updates 1.1 M
Installing for dependencies:
zlib-devel x86_64 1.2.3-29.el6 base 44 k

Transaction Summary
================================================================================
Install 2 Package(s)

Total download size: 1.1 M
Installed size: 8.6 M
Is this ok [y/N]: y
Downloading Packages:
http://centosh2.centos.org/centos/6...es/libxml2-devel-2.7.6-14.el6_5.1.x86_64.rpm: [Errno 12] Timeout on http://centosh2.centos.org/centos/6...es/libxml2-devel-2.7.6-14.el6_5.1.x86_64.rpm: (28, 'Operation too slow. Less than 1 bytes/sec transfered the last 30 seconds')
Trying other mirror.
(1/2): libxml2-devel-2.7.6-14.el6_5.1.x86_64.rpm | 1.1 MB 00:00
(2/2): zlib-devel-1.2.3-29.el6.x86_64.rpm | 44 kB 00:00
--------------------------------------------------------------------------------
Total 11 kB/s | 1.1 MB 01:39
Running rpm_check_debug
Running Transaction Test
Transaction Test Succeeded
Running Transaction
Installing : zlib-devel-1.2.3-29.el6.x86_64 1/2
Installing : libxml2-devel-2.7.6-14.el6_5.1.x86_64 2/2
Verifying : zlib-devel-1.2.3-29.el6.x86_64 1/2
Verifying : libxml2-devel-2.7.6-14.el6_5.1.x86_64 2/2

Installed:
libxml2-devel.x86_64 0:2.7.6-14.el6_5.1

Dependency Installed:
zlib-devel.x86_64 0:1.2.3-29.el6

Complete!
[root@louks php-5.3.28]#
 
Its taking ages to post anything because everything has to be checked by a moderator apparently.. anyway whenever this reply shows up, I tried the /configure again and it went through and stopped at this:

checking libxml2 install dir... /usr/local/php5328-cgi
checking for xml2-config path... /usr/bin/xml2-config
checking whether libxml build works... yes
checking for OpenSSL support... yes
checking for Kerberos support... yes
checking for krb5-config... no
checking for DSA_get_default_method in -lssl... no
checking for X509_free in -lcrypto... no
checking for pkg-config... /usr/bin/pkg-config
configure: error: Cannot find OpenSSL's <evp.h>
 
Typical, that reply was accepted. there's another one waiting that has the results of the yum upgrade update.
 
Hi nlouks,

I can provide hands-on-service if you want. No cost.
If you want to use this service, please provide me with the credentials and I will have a look at it.
 
Hi nlouks,

I can provide hands-on-service if you want. No cost.
If you want to use this service, please provide me with the credentials and I will have a look at it.

can do, we have a few sites on there of our own and a few customer ones. How do I get the details to you as obviously I cant post them here.
 
Back
Top