curl-users
Problem using curl in a Apache module
Date: Tue, 26 Mar 2013 09:06:28 +0100
I'm trying to do a Apache module in C and in this module I'm using curl.
With APXS, I can to deploy the module into Apache, but when I try to
restart Apache, it shows me this error. "undefined symbol:
curl_easy_perform. Action 'configtest' failed."
The module is trivial... only a example of how to made a connection via
HTTP from a Apache module to a URL.
CURL *curl;
CURLcode res;
curl = curl_easy_init();
if(curl) {
curl_easy_setopt(curl, CURLOPT_URL, "
http://localhost:9080/P23Protector/protector");
/* example.com is redirected, so we tell libcurl to follow redirection */
curl_easy_setopt(curl, CURLOPT_FOLLOWLOCATION, 1L);
/* Perform the request, res will get the return code */
res = curl_easy_perform(curl);
/* Check for errors */
if(res != CURLE_OK) {
ap_rprintf(r, "curl_easy_perform() failed: %s\n", curl_easy_strerror(res));
} else {
ap_rputs("<br/>OOOOOOOOOKKKKKKKKKKKKK.", r);
}
/* always cleanup */
curl_easy_cleanup(curl);
}
The module works fine when I don't put anything about curl, but when I
include the code that does reference to curl, the Apache server don't
restart and it shows the error.
Thanks.
-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-users
FAQ: http://curl.haxx.se/docs/faq.html
Etiquette: http://curl.haxx.se/mail/etiquette.html
Received on 2013-03-26