Question

Several versions of PCRE are installed on my host.

phpinfo() shows that PHP uses version 8.21. In addition it shows a folder: "pcre-regex=/opt/pcre"

In the shell, when I run

/opt/pcre/bin/pcretest -C

the server shows more information for 8.21.

When I omit the directory and run

pcretest -C

the server shows information for PCRE 7.8.

What I'd like to know is which version of PCRE Apache uses for mod_rewrite.

which httpd returned "/usr/sbin/httpd", so I tried

ldd /usr/sbin/httpd | grep pcre

but that returned nothing.

Thanks in advance for any insights!

Was it helpful?

Solution

This may be something that's happening on your specific distribution or specific to your server's setup, but apache uses libpcre and should link to it (which should appear in ldd):

libpcre.so.1 => /lib/libpcre.so.1 (0xb780c000)

You may need to rely on your package manager to see what version of the package that file belongs to:

/lib/libpcre.so.1 -> libpcre.so.1.2.1

 * Searching for libpcre.so.1.2.1 ... 
dev-libs/libpcre-8.33 (/lib/libpcre.so.1.2.1)

It's also possible that you've got 2 pcretests installed, because it's sort of odd that you'd have system libraries in the /opt/ directory. It may be the place where some libraries end up getting installed in your distribution/setup. Debian's got a libpcre3 package which installs the library as /lib/libpcre.so.3.12.1 and the test as /usr/bin/pcretest. Ultimately it's going to depend on how httpd was build and what it expects to link to. What does simply ldd /usr/sbin/httpd say?

OTHER TIPS

In the case of a cPanel install, which is my case, cPanel says that the version of PCRE installed by EasyApache is the one in the /opt folder.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top