6

This is less a question about PCRE, and more a question about updating shared libraries. The distribution of CentOS I'm running only allows for yum upgrades to version 6.6, or somewhere similar.

I'm installing an issue tracker that requires PCRE version 8.0+. I cannot uninstall the current 6.6 version of PCRE, as nearly everything depends on it, and the system would break.

Thus, I compiled and installed PCRE 8.12 from source, but even though pcretest -C showed the new version, a call to php_info() on my test page indicates that the 6.6 libraries are still being loaded. I found a link to a site suggesting how to swap out the old libraries for the new ones.

In doing so, I think something's not quite right. A few commands are reporting issues:

/usr/bin/php: error while loading shared libraries: libpcre.so.0: cannot open shared object file: No such file or directory

What exactly should I do to fix the issue? I'm not very familiar with shared/dynamic libraries. I have the following files:

[root@vps tracker]# find / -name libpcre.so* -exec ls -l '{}' \;
lrwxrwxrwx 2 root root 16 Jul 14 07:53 /lib64/libpcre.so.0 -> libpcre.so.0.0.1
lrwxrwxrwx 1 root root 16 Jul 14 07:53 /usr/local/lib/libpcre.so.0 -> libpcre.so.0.0.1
-rwxr-xr-x 1 root root 116790 Jul 14 07:53 /usr/local/lib/libpcre.so.0.0.1
lrwxrwxrwx 2 root root 16 Jul 14 07:53 /usr/local/lib/libpcre.so -> libpcre.so.0.0.1
lrwxrwxrwx 1 root root 16 Jul 14 07:16 /root/pcre-8.12/.libs/libpcre.so.0 -> libpcre.so.0.0.1
-rwxr-xr-x 1 root root 116790 Jul 14 07:16 /root/pcre-8.12/.libs/libpcre.so.0.0.1
lrwxrwxrwx 1 root root 16 Jul 14 07:16 /root/pcre-8.12/.libs/libpcre.so -> libpcre.so.0.0.1
Craig Otis
  • 287
  • 1
  • 3
  • 11
  • This all seems to stem from the fact that libpcre.so.0.0.1 doesn't exist, and the actual library (.so) file was blown away, and a link now exists in its place? – Craig Otis Jul 14 '11 at 13:21

3 Answers3

6

Success! I blew away the existing libraries, everything that wasn't in /root/pcre-8.12/, then ran the ./configure; make; make install from the source directory.

It installed properly, but still showed me a similar error. I noticed:

[root@vps pcre-8.12]# ldd /usr/sbin/httpd
libm.so.6 => /lib64/libm.so.6 (0x00002b3c8a9dd000)
libpcre.so.0 => not found
(bunch of others)

That the libraries were in /lib64/, while the only link created by the source installer was:

/usr/local/lib/libpcre.so.0

So, I simply created a link in /lib64/:

[root@vps tracker]# link /usr/local/lib/libpcre.so.0.0.1 /lib64/libpcre.so.0

And everything seems to be great!

Craig Otis
  • 287
  • 1
  • 3
  • 11
3

Perhaps

ldd /usr/bin/php

will show where php is expecting to find the pcre shared libraries.

0

In my case I fixed it with the following command, changing the execution limits:

echo "php-fpm - stack -1" >>/etc/security/limits.conf

echo "apache - stack -1" >>/etc/security/limits.conf

su apache --shell /bin/bash --command "ulimit -s"

mkdir -p /etc/systemd/system/php-fpm.service.d

echo [Service] >/etc/systemd/system/php-fpm.service.d/ulimit.conf

echo LimitSTACK=infinity >>/etc/systemd/system/php-fpm.service.d/ulimit.conf

mkdir -p /etc/systemd/system/nginx.service.d

echo [Service] >/etc/systemd/system/nginx.service.d/ulimit.conf

echo LimitSTACK=infinity >>/etc/systemd/system/nginx.service.d/ulimit.conf

echo "fs.file-max=500000" >> /etc/sysctl.conf

systemctl daemon-reload

systemctl restart php-fpm