PHP Startup Unable to load dynamic library

General Tech Bugs & Fixes 2 years ago

0 2 0 0 0 tuteeHUB earn credit +10 pts

5 Star Rating 1 Rating

Posted on 16 Aug 2022, this text provides information on Bugs & Fixes related to General Tech. Please note that while accuracy is prioritized, the data presented might not be entirely correct or up-to-date. This information is offered for general knowledge and informational purposes only, and should not be considered as a substitute for professional advice.

Take Quiz To Earn Credits!

Turn Your Knowledge into Earnings.

tuteehub_quiz

Answers (2)

Post Answer
profilepic.png
manpreet Tuteehub forum best answer Best Answer 2 years ago

 

I'm getting this error in my apache error log while trying to get cURL to work on PHP:

PHP Warning:  PHP Startup: Unable to load dynamic library '/usr/lib/php5/20121212/curl.so' - /usr/lib/php5/20121212/curl.so: symbol curl_easy_pause, version CURL_OPENSSL_3 not defined in file libcurl.so.4 with link time reference in Unknown on line 0

The file it references is there in that location and I'm trying to figure out if I've missed any dependancies while installing curl for PHP. There are no errors when I use curl -V on the command line.

I've tried the following commands:

sudo apt-get install php5-curl
sudo apt-get update
sudo apt-get install openssl

I've also tried removing php completely and installing it from scratch using the following command:

sudo apt-get install php5-common libapache2-mod-php5 php5-cli

Then after:

sudo apt-get install php5-curl

What am I missing here?

My software versions:

PHP 5.5.9-1ubuntu4.2 (cli) (built: Jun 25 2014 17:17:37) 
curl 7.16.0 (x86_64-unknown-linux-gnu) libcurl/7.16.0
Ubuntu 14.04

Thanks in advance

profilepic.png
manpreet 2 years ago

In your system are installed two different version of libcurl:

  • libcurl3.so that is a symbolic link to libcurl4.so that point to libcurl.so.4.3.0

lrwxrwxrwx 1 root root 12 Apr 1 13:43 /usr/lib/x86_64-linux-gnu/libcurl.so.3 -> libcurl.so.4 lrwxrwxrwx 1 root root 16 Apr 1 13:43 /usr/lib/x86_64-linux-gnu/libcurl.so.4 -> libcurl.so.4.3.0 -rw-r--r-- 1 root root 422696 Apr 1 13:43 /usr/lib/x86_64-linux-gnu/libcurl.so.4.3.0

  • a local version of libcurl.so.4 that is a link to libcurl.so.4.0.0

lrwxrwxrwx 1 root root 16 Jun 18 09:26 /usr/local/lib/libcurl.so.4 -> libcurl.so.4.0.0 -rwxr-xr-x 1 root root 1146079 Jun 18 09:26 /usr/local/lib/libcurl.so.4.0.0

This local library /usr/local/lib/libcurl.so.4 is loaded before /usr/lib/x86_64-linux-gnu/libcurl.so.4. We can see ld library order using command strings /etc/ld.so.cache.

As I can see in find / -name "*libcurl*" -exec ls -l {} \; -print output, you installed a source package of libcurl-7.16.0 in /usr/local/src/curl-7.16.0/ and I guess you compiled and generated /usr/local/lib/libcurl.so.4.0.0.

The missing method curl_easy_pause is present in libcurl since 7.18.0 and that's why I got the error, your system is using libcurl-7.16.0.

In order to fix this issue, remove wrong libcurl and update ld.so cache:

     sudo rm /usr/local/lib/libcurl*
     sudo ldconfig -v

I suggest to remove /usr/local/src/curl-7.16.0 directory to prevent any other kind of problem.


0 views   0 shares

No matter what stage you're at in your education or career, TuteeHub will help you reach the next level that you're aiming for. Simply,Choose a subject/topic and get started in self-paced practice sessions to improve your knowledge and scores.

tuteehub community

Join Our Community Today

Ready to take your education and career to the next level? Register today and join our growing community of learners and professionals.

tuteehub community