Reputation: 545
I compiled curl after cloning the repo using the following commands:
./buildconf
./configure --with-libssh2
make
sudo make install
However, after sudo make install, if
curl -V
, I get: bash: /usr/bin/curl: No such file or directory
. /usr/local/bin/curl -V
, I get: /usr/local/bin/curl: symbol lookup error: /usr/local/bin/curl: undefined symbol: curl_mime_type
.I tried getting around this by adding the path to curl/src to my PATH variable, and that made the curl command work from the terminal for my user. But if I try installing php-curl
, apache understandably doesn't see curl and installs a different one.
Any ideas on how I can fix this?
Edit: The other post referred to in the comments was asking where to find the executable after compiling. That part was answered. But I still can't get curl to work without adding an entry to my PATH variable, which doesn't seem right. That's the part I'm trying to figure out now.
Upvotes: 4
Views: 8612
Reputation: 58034
If you don't use configure's --prefix
option, the default installation will happen in /usr/local
so curl ends up at /usr/local/bin/curl
.
The symbol it reports to be missing is a recent addition to libcurl, which indicates that you're invoking a new curl tool that loads and uses an older libcurl - ie not the one you just installed but one from a previous (system?) install.
You can verify which libcurl your curl loads by invoking
$ ldd /usr/local/bin/curl | grep libcurl
You can change which libcurl your curl loads in one of several way, neither of which is curl specific so I'll just briefly mention the methods here to be further explained elsewhere:
LD_LIBRARY_PATH
in the shell before you invoke curl/etc/ld.so.conf
and make sure the order of the search path makes the new libcurl gets found before the old one.LDFLAGS=-Wl,-R/usr/local/ssl/lib ./configure ...
It is generally not advised to replace the system installed libcurl with your custom build. Mostly because you might have an application or two that depend on specifics of that build. When you install your own libcurl from source, it is generally better to keep it installed in a separate path so that it can co-exist with the one already installed in your syste,.
Upvotes: 12