PCRE version compiled by EasyApache and used by mod_rewrite

regex

Member
Jul 24, 2012
5
0
1
cPanel Access Level
Root Administrator
Hi there,
I am trying to find out which version of PCRE mod_rewrite is using.
There are several versions of PCRE on the host. The version used by PHP is easy to see via phpinfo().
I have a feeling that mod_rewrite is using a much older version of PCRE, perhaps 7.x.

I am not finding the details in EasyApache, and ldd /usr/sbin/httpd returns "not a dynamic executable".
Would be grateful for any clues about how to figure this out. :)

In advance, many thanks.
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,880
2,258
463
Hello :)

The version of PCRE installed by EasyApache is found in the /opt directory. You can check the version via:

Code:
/opt/pcre/bin/pcretest -C
If you are having issues with Apache being linked to the wrong version of PCRE, ensure you review internal case 58625:

[Case 58625] PCRE problems

Thank you.
 

regex

Member
Jul 24, 2012
5
0
1
cPanel Access Level
Root Administrator
The version of PCRE installed by EasyApache is found in the /opt directory.
Hello Michael,
thank you for your kind reply.

To make sure I understand, does this mean, then, that every component reported by httpd -l that might use pcre will use the version in the /opt directory?

I ask because there seem to be three versions: 7.8, 8.21, 8.31:

pcretest -C => version 7.8
/usr/bin/pcretest -C => version 7.8
/opt/pcre/bin/pcretest -C => version 8.21
/home/virtfs/user/opt/pcre/bin/pcretest -C => version 8.21
/home/virtfs/user/usr/local/cpanel/3rdparty/bin/pcretest -C => version 8.31
/home/virtfs/user/usr/bin/pcretest -C => version 7.8
/usr/local/cpanel/3rdparty/bin/pcretest -C => version 8.31

I see that PHP uses the pcre in the folder you mentioned: "--with-pcre-regex=/opt/pcre"

But just want to make sure about the components reported by httpd -l

Thanks heaps,
Wishing you a beautiful last day of the year
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,880
2,258
463
Yes, Apache should utilize the version of PCRE found in the /opt directory. However, there is an existing bug that results in this not happening in some cases. It's referenced here:

[Case 58625] PCRE problems

Thank you.