The shared library libpcre cannot be found when apache2 is started.

Source: Internet
Author: User

After Apache is installed, the system prompts that libpcre. so.1 cannot be found at startup:

 
/Usr/local/apache2/bin/httpd: ErrorWhileLoading shared libraries: libpcre. So.1: Cannot open sharedObject File: No suchFileOr directory

 

Use LDD to view httpd dependent database information:

 # LDD httpdlinux -Vdso. So. 1 => ( 0x00007fff691ff000  ) Libpcre. So.  1 => Not foundlibaprutil - 1 . So.0 =>/Usr/local/apache2/lib/libaprutil- 1 . So. 0 ( 0x00007ff847f31000  ) Libapr - 1 . So. 0 =>/Usr/local/apache2/lib/libapr- 1 . So. 0 ( 0x00007ff847d00000  ) Libpthread. So.  0 = & Gt;/lib/x86_64-linux-gnu/libpthread. So.0 ( 0x00007ff847ae3000  ) Libc. So.  6 /Lib/x86_64-linux-gnu/libc. So. 6 ( 0x00007ff8470000000  ) Libexpat. So.  0 =>/Usr/local/apache2/lib/libexpat. So. 0 ( 0x00007ff8474fb000  ) Libcrypt. So.  1 /Lib/x86_64-linux-gnu/libcrypt. So. 1 (0x00007ff8472c2000  ) Libdl. So.  2 = & Gt;/lib/x86_64-linux-gnu/libdl. So. 2 ( 0x00007ff8470be000  ) /Lib64/ LD -Linux-x86- 64 . So. 2 ( 0x00007ff848165000 )

The libpcre. so.1 library is not found.

 

Solution:

1. Search for the libpcre. so.1 file and find it in the/usr/local/lib directory.

2. Create the file libc. conf in the/etc/lD. So. conf. d directory and add the/usr/local/lib directory to the file:

/Usr/local/lib

3. Run the ldconfig command:

 
SudoLdconfig

4. Run the LDD command to check whether libpcre. so.1 has been found:

 # LDD httpdlinux -Vdso. So. 1 => ( 0x00007fffcc3ff000  ) Libpcre. So.  1 =>/Usr/local/lib/libpcre. So. 1 ( 0x00007f2f68f98000  ) Libaprutil - 1 . So. 0 =>/Usr/local/apache2/lib/libaprutil-1 . So. 0 ( 0x00007f2f68d76000  ) Libapr - 1 . So. 0 =>/Usr/local/apache2/lib/libapr- 1 . So. 0 ( 0x00007f2f68b45000  ) Libpthread. So.  0 = & Gt;/lib/x86_64-linux-gnu/libpthread. So. 0 ( 0x00007f2f68928000 ) Libc. So.  6 /Lib/x86_64-linux-gnu/libc. So. 6 ( 0x00007f2f6856b000  ) Libexpat. So.  0 =>/Usr/local/apache2/lib/libexpat. So. 0 ( 0x00007f2f68340000  ) Libcrypt. So.  1 /Lib/x86_64-linux-gnu/libcrypt. So. 1 ( 0x00007f2f680000000  ) Libdl. So. 2 = & Gt;/lib/x86_64-linux-gnu/libdl. So. 2 ( 0x00007f2f67f03000  ) /Lib64/ LD -Linux-x86- 64 . So. 2 ( 0x00007f2f691c7000 )

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.