Upgrade PCRE from 7.8 to 8.x on CentOS 6

A WordPress plugin required PCRE 8.x for it to work. The following instructions were taken from the source cited below and worked flawlessly.

The step below determined the version of PCRE and whether there was PHP support for it.

[root@server]# pcretest -C
PCRE version 7.8 2008-09-05
Compiled with
  UTF-8 support
  Unicode properties support
  Newline sequence is LF
  \R matches all Unicode newlines
  Internal link size = 2
  POSIX malloc threshold = 10
  Default match limit = 10000000
  Default recursion depth limit = 10000000
  Match recursion uses stack
[root@server]# php -i | grep PCRE
PCRE (Perl Compatible Regular Expressions) Support => enabled
PCRE Library Version => 7.8 2008-09-05
[root@server]# rpm -q --queryformat "%{name}.%{arch}\n" pcre
pcre.x86_64

To install the newer version of PCRE create a link to the repository.

echo '[utter-ramblings]
name=Utter Ramblings
baseurl=https://yum.jasonlitka.com/EL5/x86_64/
gpgkey=https://yum.jasonlitka.com/RPM-GPG-KEY-jlitka
enabled=1
gpgcheck=1' > /etc/yum.repos.d/utter-ramblings.repo

Yum update

[root@server]# yum update pcre
Loaded plugins: fastestmirror
Setting up Update Process
Loading mirror speeds from cached hostfile
 * base: mirror.rackspace.com
 * epel: fedora-epel.mirror.lstn.net
 * extras: repo1.dal.innoscale.net
 * updates: mirror.raystedman.net
utter-ramblings                                                                                                                                                                | 2.3 kB     00:00 ...
utter-ramblings/primary_db                                                                                                                                                     | 112 kB     00:00
Resolving Dependencies
--> Running transaction check
---> Package pcre.x86_64 0:7.8-7.el6 will be updated
---> Package pcre.x86_64 0:8.13-1.jason.2 will be an update
--> Finished Dependency Resolution

Dependencies Resolved

======================================================================================================================================================================================================
 Package                                   Arch                                        Version                                             Repository                                            Size
======================================================================================================================================================================================================
Updating:
 pcre                                      x86_64                                      8.13-1.jason.2                                      utter-ramblings                                      562 k

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

Check the version

[root@sever]# php -i | grep PCRE
PCRE (Perl Compatible Regular Expressions) Support => enabled
PCRE Library Version => 8.13 2011-08-16

Restart Apache

service httpd restart

Downgrade

To downgrade.

yum downgrade pcre --disablerepo utter-ramblings

Source(s)
https://yum.jasonlitka.com/EL5/x86_64/

https://peterfisher.me.uk/server-side/upgrading-pcre/