| Daniel Stenberg | c59baa0 | 2001-02-12 10:05:09 +0000 | [diff] [blame^] | 1 | Updated: February 12, 2001 (http://curl.haxx.se/docs/faq.shtml) |
| Daniel Stenberg | 7c37c6a | 2000-05-22 17:35:35 +0000 | [diff] [blame] | 2 | _ _ ____ _ |
| 3 | ___| | | | _ \| | |
| 4 | / __| | | | |_) | | |
| 5 | | (__| |_| | _ <| |___ |
| 6 | \___|\___/|_| \_\_____| |
| 7 | |
| 8 | FAQ |
| 9 | |
| Daniel Stenberg | c3318b4 | 2000-08-17 14:06:42 +0000 | [diff] [blame] | 10 | 1. Philosophy |
| 11 | 1.1 What is cURL? |
| 12 | 1.2 What is libcurl? |
| 13 | 1.3 What is cURL not? |
| 14 | 1.4 When will you make curl do XXXX ? |
| Daniel Stenberg | 7c37c6a | 2000-05-22 17:35:35 +0000 | [diff] [blame] | 15 | |
| Daniel Stenberg | c3318b4 | 2000-08-17 14:06:42 +0000 | [diff] [blame] | 16 | 2. Install Related Problems |
| 17 | 2.1 configure doesn't find OpenSSL even when it is installed |
| 18 | 2.1.1. native linker doesn't find openssl |
| 19 | 2.1.2. only the libssl lib is missing |
| 20 | 2.2 Does curl work/build with other SSL libraries? |
| 21 | 2.3 Where can I find a copy of LIBEAY32.DLL? |
| 22 | 2.4 Does cURL support Socks (RFC 1928) ? |
| Daniel Stenberg | 7c37c6a | 2000-05-22 17:35:35 +0000 | [diff] [blame] | 23 | |
| Daniel Stenberg | c3318b4 | 2000-08-17 14:06:42 +0000 | [diff] [blame] | 24 | 3. Usage Problems |
| 25 | 3.1 curl: (1) SSL is disabled, https: not supported |
| 26 | 3.2 How do I tell curl to resume a transfer? |
| 27 | 3.3 Why doesn't my posting using -F work? |
| 28 | 3.4 How do I tell curl to run custom FTP commands? |
| 29 | 3.5 How can I disable the Pragma: nocache header? |
| 30 | 3.6 Does curl support javascript, ASP, XML, XHTML or HTML version Y? |
| 31 | 3.7 Can I use curl to delete/rename a file through FTP? |
| 32 | 3.8 How do I tell curl to follow HTTP redirects? |
| Daniel Stenberg | bd0bd35 | 2001-01-29 10:16:47 +0000 | [diff] [blame] | 33 | 3.9 How do I use curl in PHP? |
| Daniel Stenberg | c59baa0 | 2001-02-12 10:05:09 +0000 | [diff] [blame^] | 34 | 3.10 What about SOAP, WEBDAV, XML-RPC or similar protocols over HTTP? |
| Daniel Stenberg | 7c37c6a | 2000-05-22 17:35:35 +0000 | [diff] [blame] | 35 | |
| Daniel Stenberg | c3318b4 | 2000-08-17 14:06:42 +0000 | [diff] [blame] | 36 | 4. Running Problems |
| 37 | 4.1 Problems connecting to SSL servers. |
| Daniel Stenberg | e26ee09 | 2001-01-15 10:26:37 +0000 | [diff] [blame] | 38 | 4.2 Why do I get problems when I use & or % in the URL? |
| Daniel Stenberg | c3318b4 | 2000-08-17 14:06:42 +0000 | [diff] [blame] | 39 | 4.3 How can I use {, }, [ or ] to specify multiple URLs? |
| 40 | 4.4 Why do I get downloaded data even though the web page doesn't exist? |
| 41 | 4.5 Why do I get return code XXX from a HTTP server? |
| 42 | 4.5.1 "400 Bad Request" |
| 43 | 4.5.2 "401 Unauthorized" |
| 44 | 4.5.3 "403 Forbidden" |
| 45 | 4.5.4 "404 Not Found" |
| 46 | 4.5.5 "405 Method Not Allowed" |
| 47 | 4.6 Can you tell me what error code 142 means? |
| Daniel Stenberg | 09ba856 | 2000-10-27 12:25:00 +0000 | [diff] [blame] | 48 | 4.7 How do I keep usernames and passwords secret in Curl command lines? |
| 49 | 4.8 I found a bug! |
| Daniel Stenberg | 2c10037 | 2000-12-19 07:30:51 +0000 | [diff] [blame] | 50 | 4.9 Curl can't authenticate to the server that requires NTLM? |
| Daniel Stenberg | 7c37c6a | 2000-05-22 17:35:35 +0000 | [diff] [blame] | 51 | |
| Daniel Stenberg | c3318b4 | 2000-08-17 14:06:42 +0000 | [diff] [blame] | 52 | 5. libcurl Issues |
| Daniel Stenberg | 7d09e51 | 2001-01-11 12:52:07 +0000 | [diff] [blame] | 53 | 5.1 Is libcurl thread-safe? |
| Daniel Stenberg | a40b55d | 2000-11-22 07:27:26 +0000 | [diff] [blame] | 54 | 5.2 How can I receive all data into a large memory chunk? |
| Daniel Stenberg | 2c10037 | 2000-12-19 07:30:51 +0000 | [diff] [blame] | 55 | 5.3 How do I fetch multiple files with libcurl? |
| Daniel Stenberg | 910fc85 | 2000-12-30 11:48:51 +0000 | [diff] [blame] | 56 | 5.4 Does libcurl do Winsock initing on win32 systems? |
| Daniel Stenberg | 5d7b32d | 2001-02-04 20:08:42 +0000 | [diff] [blame] | 57 | 5.5 Does CURLOPT_FILE and CURLOPT_INFILE work on win32 ? |
| Daniel Stenberg | 6dc5c6f | 2001-01-27 20:51:31 +0000 | [diff] [blame] | 58 | 5.6 What about Keep-Alive or persistant connections? |
| Daniel Stenberg | 7c37c6a | 2000-05-22 17:35:35 +0000 | [diff] [blame] | 59 | |
| Daniel Stenberg | c3318b4 | 2000-08-17 14:06:42 +0000 | [diff] [blame] | 60 | 6. License Issues |
| 61 | 6.1 I have a GPL program, can I use the libcurl library? |
| 62 | 6.2 I have a closed-source program, can I use the libcurl library? |
| Daniel Stenberg | 31b8eea | 2000-08-23 07:27:00 +0000 | [diff] [blame] | 63 | 6.3 I have a BSD licensed program, can I use the libcurl library? |
| 64 | 6.4 I have a program that uses LGPL libraries, can I use libcurl? |
| 65 | 6.5 Can I modify curl/libcurl for my program and keep the changes secret? |
| 66 | 6.6 Can you please change the curl/libcurl license to XXXX? |
| Daniel Stenberg | c3318b4 | 2000-08-17 14:06:42 +0000 | [diff] [blame] | 67 | |
| 68 | ============================================================================== |
| 69 | |
| 70 | 1. Philosophy |
| 71 | |
| 72 | 1.1 What is cURL? |
| 73 | |
| 74 | cURL (or simply just 'curl') is a command line tool for getting or sending |
| 75 | files using URL syntax. The name is a play on 'Client for URLs', originally |
| Daniel Stenberg | 09ba856 | 2000-10-27 12:25:00 +0000 | [diff] [blame] | 76 | with URL spelled in uppercase to make it obvious it deals with URLs. The |
| 77 | fact it can also be pronounced 'see URL' also helped. |
| Daniel Stenberg | c3318b4 | 2000-08-17 14:06:42 +0000 | [diff] [blame] | 78 | |
| 79 | Curl supports a range of common internet protocols, currently including |
| Daniel Stenberg | 7d09e51 | 2001-01-11 12:52:07 +0000 | [diff] [blame] | 80 | HTTP, HTTPS, FTP, GOPHER, LDAP, DICT, TELNET and FILE. |
| Daniel Stenberg | c3318b4 | 2000-08-17 14:06:42 +0000 | [diff] [blame] | 81 | |
| Daniel Stenberg | 7d09e51 | 2001-01-11 12:52:07 +0000 | [diff] [blame] | 82 | We spell it cURL or just curl. |
| Daniel Stenberg | 887e728 | 2001-01-03 09:13:07 +0000 | [diff] [blame] | 83 | |
| Daniel Stenberg | c3318b4 | 2000-08-17 14:06:42 +0000 | [diff] [blame] | 84 | 1.2 What is libcurl? |
| 85 | |
| Daniel Stenberg | a3eb91f | 2001-01-15 14:59:07 +0000 | [diff] [blame] | 86 | libcurl is a reliable, higly portable multiprotocol file transfer library. |
| Daniel Stenberg | c3318b4 | 2000-08-17 14:06:42 +0000 | [diff] [blame] | 87 | |
| 88 | Any application is free to use libcurl, even commercial or closed-source |
| Daniel Stenberg | 9012f8c | 2001-01-15 10:28:41 +0000 | [diff] [blame] | 89 | ones. |
| Daniel Stenberg | c3318b4 | 2000-08-17 14:06:42 +0000 | [diff] [blame] | 90 | |
| 91 | 1.3 What is cURL not? |
| Daniel Stenberg | e9640b6 | 2000-08-02 07:17:56 +0000 | [diff] [blame] | 92 | |
| Daniel Stenberg | c3318b4 | 2000-08-17 14:06:42 +0000 | [diff] [blame] | 93 | Curl is *not*, I repeat, *not* a wget clone even though that is a very |
| 94 | common misconception. Never, during curl's development, have I intended curl |
| 95 | to replace wget or compete on its market. Curl is targeted at single-shot |
| 96 | file transfers. |
| Daniel Stenberg | ef34ad2 | 2000-06-02 12:45:23 +0000 | [diff] [blame] | 97 | |
| Daniel Stenberg | c3318b4 | 2000-08-17 14:06:42 +0000 | [diff] [blame] | 98 | Curl is not a web site mirroring program. If you wanna use curl to mirror |
| 99 | something: fine, go ahead and write a script that wraps around curl to make |
| 100 | it reality (like curlmirror.pl does). |
| Daniel Stenberg | ef34ad2 | 2000-06-02 12:45:23 +0000 | [diff] [blame] | 101 | |
| Daniel Stenberg | c3318b4 | 2000-08-17 14:06:42 +0000 | [diff] [blame] | 102 | Curl is not an ftp site mirroring program. Sure, get and send ftp with curl |
| 103 | but if you want systematic and sequential behaviour you should write a |
| 104 | script (or write a new program that interfaces libcurl) and do it. |
| 105 | |
| 106 | Curl is not a PHP tool, even though it works perfectly well when used from |
| 107 | or with PHP. |
| 108 | |
| Daniel Stenberg | 31b8eea | 2000-08-23 07:27:00 +0000 | [diff] [blame] | 109 | Curl is not a single-OS program. Curl exists, compiles, builds and runs |
| Daniel Stenberg | c59baa0 | 2001-02-12 10:05:09 +0000 | [diff] [blame^] | 110 | under a wide range of operating systems, including all modern Unixes (and a |
| 111 | bunch of older ones too), Windows, Amiga, BeOS, OS/2, OS X, QNX etc. |
| Daniel Stenberg | 31b8eea | 2000-08-23 07:27:00 +0000 | [diff] [blame] | 112 | |
| Daniel Stenberg | c3318b4 | 2000-08-17 14:06:42 +0000 | [diff] [blame] | 113 | 1.4 When will you make curl do XXXX ? |
| 114 | |
| 115 | I love suggestions of what to change in order to make curl and libcurl |
| 116 | better. I do however believe in a few rules when it comes to the future of |
| 117 | curl: |
| 118 | |
| 119 | * It is to remain a command line tool. If you want GUIs or fancy scripting |
| 120 | capabilities, you're free to write another tool that uses libcurl and that |
| 121 | offers this. There's no point in having one single tool that does every |
| 122 | imaginable thing. That's also one of the great advantages of having the |
| 123 | core of curl as a library: libcurl. |
| 124 | |
| 125 | * I do not add things to curl that other small and available tools already |
| 126 | do very fine at the side. Curl's output is fine to pipe into another |
| 127 | program or redirect to another file for the next program to interpret. |
| 128 | |
| 129 | * I focus on protocol related issues and improvements. If you wanna do more |
| Daniel Stenberg | 5f8e93d | 2000-10-25 07:41:58 +0000 | [diff] [blame] | 130 | magic with the supported protocols than curl currently does, chances are |
| Daniel Stenberg | c3318b4 | 2000-08-17 14:06:42 +0000 | [diff] [blame] | 131 | big I will agree. If you wanna add more protocols, I may very well |
| 132 | agree. |
| 133 | |
| 134 | * If you want me to make all the work while you wait for me to implement it |
| 135 | for you, that is not a very friendly attitude. I spend a considerable time |
| 136 | already on maintaining and developing curl. In order to get more out of |
| 137 | me, I trust you will offer some of your time and efforts in return. |
| 138 | |
| 139 | * If you write the code, chances are bigger that it will get into curl |
| 140 | faster. |
| 141 | |
| 142 | 2. Install Related Problems |
| 143 | |
| 144 | 2.1. configure doesn't find OpenSSL even when it is installed |
| Daniel Stenberg | 7c37c6a | 2000-05-22 17:35:35 +0000 | [diff] [blame] | 145 | |
| Daniel Stenberg | ef34ad2 | 2000-06-02 12:45:23 +0000 | [diff] [blame] | 146 | This may be because of several reasons. |
| Daniel Stenberg | 7c37c6a | 2000-05-22 17:35:35 +0000 | [diff] [blame] | 147 | |
| Daniel Stenberg | 09ba856 | 2000-10-27 12:25:00 +0000 | [diff] [blame] | 148 | 2.1.1. native linker doesn't find openssl |
| Daniel Stenberg | 7c37c6a | 2000-05-22 17:35:35 +0000 | [diff] [blame] | 149 | |
| Daniel Stenberg | bfb1690 | 2000-08-17 11:42:59 +0000 | [diff] [blame] | 150 | Affected platforms: |
| 151 | Solaris (native cc compiler) |
| 152 | HPUX (native cc compiler) |
| 153 | SGI IRIX (native cc compiler) |
| Daniel Stenberg | 13962ad | 2000-09-28 10:26:44 +0000 | [diff] [blame] | 154 | SCO UNIX (native cc compiler) |
| Daniel Stenberg | 7c37c6a | 2000-05-22 17:35:35 +0000 | [diff] [blame] | 155 | |
| Daniel Stenberg | ef34ad2 | 2000-06-02 12:45:23 +0000 | [diff] [blame] | 156 | When configuring curl, I specify --with-ssl. OpenSSL is installed in |
| 157 | /usr/local/ssl Configure reports SSL in /usr/local/ssl, but fails to find |
| 158 | CRYPTO_lock in -lcrypto |
| Daniel Stenberg | 7c37c6a | 2000-05-22 17:35:35 +0000 | [diff] [blame] | 159 | |
| Daniel Stenberg | ef34ad2 | 2000-06-02 12:45:23 +0000 | [diff] [blame] | 160 | Cause: The cc for this test places the -L/usr/local/ssl/lib AFTER |
| 161 | -lcrypto, so ld can't find the library. This is due to a bug in the GNU |
| 162 | autoconf tool. |
| 163 | |
| 164 | Workaround: Specifying "LDFLAGS=-L/usr/local/ssl/lib" in front of |
| 165 | ./configure places the -L/usr/local/ssl/lib early enough in the command |
| 166 | line to make things work |
| 167 | |
| Daniel Stenberg | bfb1690 | 2000-08-17 11:42:59 +0000 | [diff] [blame] | 168 | Solution submitted by: Bob Allison <allisonb@users.sourceforge.net> |
| Daniel Stenberg | ef34ad2 | 2000-06-02 12:45:23 +0000 | [diff] [blame] | 169 | |
| Daniel Stenberg | 09ba856 | 2000-10-27 12:25:00 +0000 | [diff] [blame] | 170 | 2.1.2. only the libssl lib is missing |
| Daniel Stenberg | ef34ad2 | 2000-06-02 12:45:23 +0000 | [diff] [blame] | 171 | |
| 172 | If all include files and the libcrypto lib is present, with only the |
| 173 | libssl being missing according to configure, this is mostly likely because |
| 174 | a few functions are left out from the libssl. |
| 175 | |
| 176 | If the function names missing include RSA or RSAREF you can be certain |
| 177 | that this is because libssl requires the RSA and RSASEF libs to build. |
| 178 | |
| 179 | See the INSTALL file section that explains how to add those libs to |
| 180 | configure. Make sure that you remove the config.cache file before you |
| 181 | rerun configure with the new flags. |
| 182 | |
| Daniel Stenberg | c3318b4 | 2000-08-17 14:06:42 +0000 | [diff] [blame] | 183 | 2.2. Does curl work/build with other SSL libraries? |
| Daniel Stenberg | e9640b6 | 2000-08-02 07:17:56 +0000 | [diff] [blame] | 184 | |
| 185 | Curl has been written to use OpenSSL, although I doubt there would be much |
| 186 | problems using a different library. I just don't know any other free one and |
| 187 | that has limited my possibilities to develop against anything else. |
| 188 | |
| 189 | If anyone does "port" curl to use a commercial SSL library, I am of course |
| 190 | very interested in getting the patch! |
| 191 | |
| Daniel Stenberg | c3318b4 | 2000-08-17 14:06:42 +0000 | [diff] [blame] | 192 | 2.3. Where can I find a copy of LIBEAY32.DLL? |
| Daniel Stenberg | e9640b6 | 2000-08-02 07:17:56 +0000 | [diff] [blame] | 193 | |
| 194 | That is an OpenSSL binary built for Windows. |
| 195 | |
| 196 | Curl uses OpenSSL to do the SSL stuff. The LIBEAY32.DLL is what curl needs |
| 197 | on a windows machine to do https://. Check out the curl web page to find |
| 198 | accurate and up-to-date pointers to recent OpenSSL DDLs and other binary |
| 199 | packages. |
| 200 | |
| Daniel Stenberg | c3318b4 | 2000-08-17 14:06:42 +0000 | [diff] [blame] | 201 | 2.4. Does cURL support Socks (RFC 1928) ? |
| Daniel Stenberg | e9640b6 | 2000-08-02 07:17:56 +0000 | [diff] [blame] | 202 | |
| 203 | No. Nobody has wanted it that badly yet. I would appriciate patches that |
| 204 | brings this functionality. |
| 205 | |
| 206 | |
| Daniel Stenberg | c3318b4 | 2000-08-17 14:06:42 +0000 | [diff] [blame] | 207 | 3. Usage problems |
| Daniel Stenberg | e9640b6 | 2000-08-02 07:17:56 +0000 | [diff] [blame] | 208 | |
| Daniel Stenberg | c3318b4 | 2000-08-17 14:06:42 +0000 | [diff] [blame] | 209 | 3.1. curl: (1) SSL is disabled, https: not supported |
| Daniel Stenberg | e9640b6 | 2000-08-02 07:17:56 +0000 | [diff] [blame] | 210 | |
| 211 | If you get this output when trying to get anything from a https:// server, |
| 212 | it means that the configure script couldn't find all libs and include files |
| 213 | it requires for SSL to work. If the configure script fails to find them, |
| 214 | curl is simply built without SSL support. |
| 215 | |
| 216 | To get the https:// support into a curl that was previously built but that |
| 217 | reports that https:// is not supported, you should dig through the document |
| 218 | and logs and check out why the configure script doesn't find the SSL libs |
| 219 | and/or include files. |
| 220 | |
| 221 | Also, check out the other paragraph in this FAQ labeled "configure doesn't |
| 222 | find OpenSSL even when it is installed". |
| 223 | |
| Daniel Stenberg | c3318b4 | 2000-08-17 14:06:42 +0000 | [diff] [blame] | 224 | 3.2. How do I tell curl to resume a transfer? |
| Daniel Stenberg | e9640b6 | 2000-08-02 07:17:56 +0000 | [diff] [blame] | 225 | |
| 226 | Curl supports resume both ways on FTP, download ways on HTTP. |
| 227 | |
| Daniel Stenberg | 887e728 | 2001-01-03 09:13:07 +0000 | [diff] [blame] | 228 | Try the -C option. |
| Daniel Stenberg | e9640b6 | 2000-08-02 07:17:56 +0000 | [diff] [blame] | 229 | |
| Daniel Stenberg | c3318b4 | 2000-08-17 14:06:42 +0000 | [diff] [blame] | 230 | 3.3. Why doesn't my posting using -F work? |
| Daniel Stenberg | e9640b6 | 2000-08-02 07:17:56 +0000 | [diff] [blame] | 231 | |
| 232 | You can't simply use -F or -d at your choice. The web server that will |
| 233 | receive your post assumes one of the formats. If the form you're trying to |
| Daniel Stenberg | c59baa0 | 2001-02-12 10:05:09 +0000 | [diff] [blame^] | 234 | "fake" sets the type to 'multipart/form-data', then and only then you must |
| Daniel Stenberg | e9640b6 | 2000-08-02 07:17:56 +0000 | [diff] [blame] | 235 | use the -F type. In all the most common cases, you should use -d which then |
| 236 | causes a posting with the type 'application/x-www-form-urlencoded'. |
| 237 | |
| 238 | I have described this in some detail in the README.curl file, and if you |
| 239 | don't understand it the first time, read it again before you post questions |
| 240 | about this to the mailing list. I would also suggest that you read through |
| 241 | the mailing list archives for old postings and questions regarding this. |
| 242 | |
| Daniel Stenberg | c3318b4 | 2000-08-17 14:06:42 +0000 | [diff] [blame] | 243 | 3.4. How do I tell curl to run custom FTP commands? |
| Daniel Stenberg | e9640b6 | 2000-08-02 07:17:56 +0000 | [diff] [blame] | 244 | |
| 245 | You can tell curl to perform optional commands both before and/or after a |
| 246 | file transfer. Study the -Q/--quote option. |
| 247 | |
| 248 | Since curl is used for file transfers, you don't use curl to just perform |
| 249 | ftp commands without transfering anything. Therefore you must always specify |
| 250 | a URL to transfer to/from even when doing custom FTP commands. |
| 251 | |
| Daniel Stenberg | c3318b4 | 2000-08-17 14:06:42 +0000 | [diff] [blame] | 252 | 3.5. How can I disable the Pragma: nocache header? |
| Daniel Stenberg | e9640b6 | 2000-08-02 07:17:56 +0000 | [diff] [blame] | 253 | |
| 254 | You can change all internally generated headers by adding a replacement with |
| 255 | the -H/--header option. By adding a header with empty contents you safely |
| 256 | disable that one. Use -H "Pragma:" to disable that specific header. |
| 257 | |
| Daniel Stenberg | c3318b4 | 2000-08-17 14:06:42 +0000 | [diff] [blame] | 258 | 3.6. Does curl support javascript, ASP, XML, XHTML or HTML version Y? |
| Daniel Stenberg | e9640b6 | 2000-08-02 07:17:56 +0000 | [diff] [blame] | 259 | |
| 260 | To curl, all contents are alike. It doesn't matter how the page was |
| 261 | generated. It may be ASP, PHP, perl, shell-script, SSI or plain |
| 262 | HTML-files. There's no difference to curl and it doesn't even know what kind |
| 263 | of language that generated the page. |
| 264 | |
| 265 | Javascript is slightly different since that is code embedded in the HTML |
| 266 | that is sent for the client to interpret and curl has no javascript |
| 267 | interpreter. |
| 268 | |
| Daniel Stenberg | c3318b4 | 2000-08-17 14:06:42 +0000 | [diff] [blame] | 269 | 3.7. Can I use curl to delete/rename a file through FTP? |
| Daniel Stenberg | e9640b6 | 2000-08-02 07:17:56 +0000 | [diff] [blame] | 270 | |
| 271 | Yes. You specify custom ftp commands with -Q/--quote. |
| 272 | |
| 273 | One example would be to delete a file after you have downloaded it: |
| 274 | |
| 275 | curl -O ftp://download.com/coolfile -Q '-DELE coolfile' |
| 276 | |
| Daniel Stenberg | c3318b4 | 2000-08-17 14:06:42 +0000 | [diff] [blame] | 277 | 3.8 How do I tell curl to follow HTTP redirects? |
| Daniel Stenberg | e9640b6 | 2000-08-02 07:17:56 +0000 | [diff] [blame] | 278 | |
| Daniel Stenberg | c3318b4 | 2000-08-17 14:06:42 +0000 | [diff] [blame] | 279 | Curl does not follow so-called redirects by default. The Location: header |
| 280 | that informs the client about this is only interpreted if you're using the |
| 281 | -L/--location option. As in: |
| Daniel Stenberg | e9640b6 | 2000-08-02 07:17:56 +0000 | [diff] [blame] | 282 | |
| Daniel Stenberg | c3318b4 | 2000-08-17 14:06:42 +0000 | [diff] [blame] | 283 | curl -L http://redirector.com |
| 284 | |
| Daniel Stenberg | bd0bd35 | 2001-01-29 10:16:47 +0000 | [diff] [blame] | 285 | 3.9 How do I use curl in PHP? |
| Daniel Stenberg | 368e352 | 2001-01-29 10:16:21 +0000 | [diff] [blame] | 286 | |
| 287 | PHP4 has the ability to use libcurl as an internal module if built with that |
| 288 | option enabled. You then get a set of extra functions that can be used |
| 289 | within your PHP programs. You find all details about those functions in the |
| 290 | curl section in the PHP manual, see the online version at: |
| 291 | |
| 292 | http://www.php.net/manual/ref.curl.php |
| 293 | |
| 294 | PHP also offers the option to run a command line, and then you can of course |
| 295 | invoke the curl tool using a command line. This is the way to use curl if |
| 296 | you're using PHP3 or PHP4 built without curl module support. |
| 297 | |
| Daniel Stenberg | c59baa0 | 2001-02-12 10:05:09 +0000 | [diff] [blame^] | 298 | 3.10 What about SOAP, WEBDAV, XML-RPC or similar protocols over HTTP? |
| 299 | |
| 300 | Curl adheres to the HTTP spec, which basically means you can play with *any* |
| 301 | protocol that is built ontop of HTTP. Protocols such as SOAP, WEBDAV and |
| 302 | XML-RPC are all such ones. You can use -X to set custom requests and -H to |
| 303 | set custom headers (or replace internally generated ones). |
| 304 | |
| 305 | Using libcurl or PHP's curl modules is just as fine and you'd just use the |
| 306 | proper library options to do the same. |
| 307 | |
| Daniel Stenberg | c3318b4 | 2000-08-17 14:06:42 +0000 | [diff] [blame] | 308 | 4. Running Problems |
| 309 | |
| 310 | 4.1. Problems connecting to SSL servers. |
| Daniel Stenberg | e9640b6 | 2000-08-02 07:17:56 +0000 | [diff] [blame] | 311 | |
| 312 | It took a very long time before I could sort out why curl had problems |
| 313 | to connect to certain SSL servers when using SSLeay or OpenSSL v0.9+. |
| 314 | The error sometimes showed up similar to: |
| 315 | |
| 316 | 16570:error:1407D071:SSL routines:SSL2_READ:bad mac decode:s2_pkt.c:233: |
| 317 | |
| 318 | It turned out to be because many older SSL servers don't deal with SSLv3 |
| 319 | requests properly. To correct this problem, tell curl to select SSLv2 from |
| 320 | the command line (-2/--sslv2). |
| 321 | |
| 322 | I have also seen examples where the remote server didn't like the SSLv2 |
| 323 | request and instead you had to force curl to use SSLv3 with -3/--sslv3. |
| 324 | |
| Daniel Stenberg | e26ee09 | 2001-01-15 10:26:37 +0000 | [diff] [blame] | 325 | 4.2. Why do I get problems when I use & or % in the URL? |
| Daniel Stenberg | 2947010 | 2000-06-02 13:32:01 +0000 | [diff] [blame] | 326 | |
| Daniel Stenberg | c3c7739 | 2000-07-31 22:42:34 +0000 | [diff] [blame] | 327 | In general unix shells, the & letter is treated special and when used it |
| 328 | runs the specified command in the background. To safely send the & as a part |
| 329 | of a URL, you should qoute the entire URL by using single (') or double (") |
| 330 | quotes around it. |
| Daniel Stenberg | 2947010 | 2000-06-02 13:32:01 +0000 | [diff] [blame] | 331 | |
| Daniel Stenberg | c3c7739 | 2000-07-31 22:42:34 +0000 | [diff] [blame] | 332 | An example that would invoke a remote CGI that uses &-letters could be: |
| Daniel Stenberg | 8f03732 | 2000-06-06 14:09:01 +0000 | [diff] [blame] | 333 | |
| Daniel Stenberg | edcd5df | 2000-06-06 14:13:36 +0000 | [diff] [blame] | 334 | curl 'http://www.altavista.com/cgi-bin/query?text=yes&q=curl' |
| Daniel Stenberg | 8f03732 | 2000-06-06 14:09:01 +0000 | [diff] [blame] | 335 | |
| Daniel Stenberg | e26ee09 | 2001-01-15 10:26:37 +0000 | [diff] [blame] | 336 | In win32, the standard DOS shell treats the %-letter specially and you may |
| 337 | need to quote the string properly when % is used in it. |
| 338 | |
| Daniel Stenberg | 1b77c18 | 2001-01-29 10:24:51 +0000 | [diff] [blame] | 339 | Also note that if you want the literal %-letter to be part of the data you |
| 340 | pass in a POST using -d/--data you must encode it as '%25'. |
| 341 | |
| Daniel Stenberg | c3318b4 | 2000-08-17 14:06:42 +0000 | [diff] [blame] | 342 | 4.3. How can I use {, }, [ or ] to specify multiple URLs? |
| Daniel Stenberg | 2947010 | 2000-06-02 13:32:01 +0000 | [diff] [blame] | 343 | |
| Daniel Stenberg | c3c7739 | 2000-07-31 22:42:34 +0000 | [diff] [blame] | 344 | Because those letters have a special meaning to the shell, and to be used in |
| 345 | a URL specified to curl you must quote them. |
| Daniel Stenberg | 2947010 | 2000-06-02 13:32:01 +0000 | [diff] [blame] | 346 | |
| Daniel Stenberg | c3c7739 | 2000-07-31 22:42:34 +0000 | [diff] [blame] | 347 | An example that downloads two URLs (sequentially) would do: |
| Daniel Stenberg | 8f03732 | 2000-06-06 14:09:01 +0000 | [diff] [blame] | 348 | |
| Daniel Stenberg | edcd5df | 2000-06-06 14:13:36 +0000 | [diff] [blame] | 349 | curl '{curl,www}.haxx.se' |
| Daniel Stenberg | 8f03732 | 2000-06-06 14:09:01 +0000 | [diff] [blame] | 350 | |
| Daniel Stenberg | e26ee09 | 2001-01-15 10:26:37 +0000 | [diff] [blame] | 351 | To be able to use those letters as actual parts of the URL (without using |
| 352 | them for the curl URL "globbing" system), use the -g/--globoff option |
| 353 | (included in curl 7.6 and later): |
| 354 | |
| 355 | curl -g 'www.site.com/weirdname[].html' |
| 356 | |
| Daniel Stenberg | c3318b4 | 2000-08-17 14:06:42 +0000 | [diff] [blame] | 357 | 4.4. Why do I get downloaded data even though the web page doesn't exist? |
| Daniel Stenberg | 2947010 | 2000-06-02 13:32:01 +0000 | [diff] [blame] | 358 | |
| Daniel Stenberg | c3c7739 | 2000-07-31 22:42:34 +0000 | [diff] [blame] | 359 | Curl asks remote servers for the page you specify. If the page doesn't exist |
| 360 | at the server, the HTTP protocol defines how the server should respond and |
| 361 | that means that headers and a "page" will be returned. That's simply how |
| 362 | HTTP works. |
| Daniel Stenberg | 2947010 | 2000-06-02 13:32:01 +0000 | [diff] [blame] | 363 | |
| Daniel Stenberg | c3c7739 | 2000-07-31 22:42:34 +0000 | [diff] [blame] | 364 | By using the --fail option you can tell curl explicitly to not get any data |
| 365 | if the HTTP return code doesn't say success. |
| Daniel Stenberg | 8f03732 | 2000-06-06 14:09:01 +0000 | [diff] [blame] | 366 | |
| Daniel Stenberg | c3318b4 | 2000-08-17 14:06:42 +0000 | [diff] [blame] | 367 | 4.5 Why do I get return code XXX from a HTTP server? |
| Daniel Stenberg | 2947010 | 2000-06-02 13:32:01 +0000 | [diff] [blame] | 368 | |
| Daniel Stenberg | c3318b4 | 2000-08-17 14:06:42 +0000 | [diff] [blame] | 369 | RFC2616 clearly explains the return codes. I'll make a short transcript |
| 370 | here. Go read the RFC for exact details: |
| Daniel Stenberg | 2947010 | 2000-06-02 13:32:01 +0000 | [diff] [blame] | 371 | |
| Daniel Stenberg | 09ba856 | 2000-10-27 12:25:00 +0000 | [diff] [blame] | 372 | 4.5.1 "400 Bad Request" |
| Daniel Stenberg | 2947010 | 2000-06-02 13:32:01 +0000 | [diff] [blame] | 373 | |
| Daniel Stenberg | c3318b4 | 2000-08-17 14:06:42 +0000 | [diff] [blame] | 374 | The request could not be understood by the server due to malformed |
| 375 | syntax. The client SHOULD NOT repeat the request without modifications. |
| 376 | |
| Daniel Stenberg | 09ba856 | 2000-10-27 12:25:00 +0000 | [diff] [blame] | 377 | 4.5.2 "401 Unauthorized" |
| Daniel Stenberg | c3318b4 | 2000-08-17 14:06:42 +0000 | [diff] [blame] | 378 | |
| 379 | The request requires user authentication. |
| 380 | |
| Daniel Stenberg | 09ba856 | 2000-10-27 12:25:00 +0000 | [diff] [blame] | 381 | 4.5.3 "403 Forbidden" |
| Daniel Stenberg | c3318b4 | 2000-08-17 14:06:42 +0000 | [diff] [blame] | 382 | |
| 383 | The server understood the request, but is refusing to fulfill it. |
| 384 | Authorization will not help and the request SHOULD NOT be repeated. |
| 385 | |
| Daniel Stenberg | 09ba856 | 2000-10-27 12:25:00 +0000 | [diff] [blame] | 386 | 4.5.4 "404 Not Found" |
| Daniel Stenberg | c3318b4 | 2000-08-17 14:06:42 +0000 | [diff] [blame] | 387 | |
| 388 | The server has not found anything matching the Request-URI. No indication |
| 389 | is given of whether the condition is temporary or permanent. |
| 390 | |
| Daniel Stenberg | 09ba856 | 2000-10-27 12:25:00 +0000 | [diff] [blame] | 391 | 4.5.5 "405 Method Not Allowed" |
| Daniel Stenberg | c3318b4 | 2000-08-17 14:06:42 +0000 | [diff] [blame] | 392 | |
| 393 | The method specified in the Request-Line is not allowed for the resource |
| 394 | identified by the Request-URI. The response MUST include an Allow header |
| 395 | containing a list of valid methods for the requested resource. |
| 396 | |
| 397 | 4.6. Can you tell me what error code 142 means? |
| Daniel Stenberg | 2947010 | 2000-06-02 13:32:01 +0000 | [diff] [blame] | 398 | |
| Daniel Stenberg | c3c7739 | 2000-07-31 22:42:34 +0000 | [diff] [blame] | 399 | All error codes that are larger than the highest documented error code means |
| Daniel Stenberg | 887e728 | 2001-01-03 09:13:07 +0000 | [diff] [blame] | 400 | that curl has existed due to a timeout. There was no nice way for curl to |
| 401 | abort from such a condition and that's why it got this undocumented |
| 402 | error. This should not occur in releases after 7.4.1. |
| Daniel Stenberg | 2947010 | 2000-06-02 13:32:01 +0000 | [diff] [blame] | 403 | |
| Daniel Stenberg | c3318b4 | 2000-08-17 14:06:42 +0000 | [diff] [blame] | 404 | 4.7. How do I keep usernames and passwords secret in Curl command lines? |
| Daniel Stenberg | 2947010 | 2000-06-02 13:32:01 +0000 | [diff] [blame] | 405 | |
| Daniel Stenberg | c3c7739 | 2000-07-31 22:42:34 +0000 | [diff] [blame] | 406 | I see this problem as two parts: |
| Daniel Stenberg | 2947010 | 2000-06-02 13:32:01 +0000 | [diff] [blame] | 407 | |
| Daniel Stenberg | c3c7739 | 2000-07-31 22:42:34 +0000 | [diff] [blame] | 408 | The first part is to avoid having clear-text passwords in the command line |
| 409 | so that they don't appear in 'ps' outputs and similar. That is easily |
| 410 | avoided by using the "-K" option tho tell curl to read parameters from a |
| 411 | file or stdin to which you can pass the secret info. |
| Daniel Stenberg | 2947010 | 2000-06-02 13:32:01 +0000 | [diff] [blame] | 412 | |
| Daniel Stenberg | c3c7739 | 2000-07-31 22:42:34 +0000 | [diff] [blame] | 413 | To keep the passwords in your account secret from the rest of the world is |
| 414 | not a task that curl addresses. You could of course encrypt them somehow to |
| 415 | at least hide them from being read by human eyes, but that is not what |
| 416 | anyone would call security. |
| Daniel Stenberg | 2947010 | 2000-06-02 13:32:01 +0000 | [diff] [blame] | 417 | |
| Daniel Stenberg | 887e728 | 2001-01-03 09:13:07 +0000 | [diff] [blame] | 418 | Also note that regular HTTP and FTP passwords are sent in clear across the |
| 419 | network. All it takes for anyone to fetch them is to listen on the network. |
| 420 | Evesdropping is very easy. |
| 421 | |
| Daniel Stenberg | 09ba856 | 2000-10-27 12:25:00 +0000 | [diff] [blame] | 422 | 4.8 I found a bug! |
| 423 | |
| 424 | It is not a bug if the behaviour is documented. Read the docs first. |
| 425 | |
| 426 | If it is a problem with a binary you've downloaded or a package for your |
| 427 | particular platform, try contacting the person who built the package/archive |
| 428 | you have. |
| 429 | |
| 430 | If there is a bug, post a bug report in the Curl Bug Track System over at |
| Daniel Stenberg | 9012f8c | 2001-01-15 10:28:41 +0000 | [diff] [blame] | 431 | http://sourceforge.net/bugs/?group_id=976 |
| Daniel Stenberg | 09ba856 | 2000-10-27 12:25:00 +0000 | [diff] [blame] | 432 | |
| 433 | Always include as many details you can think of, including curl version, |
| 434 | operating system name and version and complete instructions how to repeat |
| 435 | the bug. |
| 436 | |
| Daniel Stenberg | 2c10037 | 2000-12-19 07:30:51 +0000 | [diff] [blame] | 437 | 4.9. Curl can't authenticate to the server that requires NTLM? |
| 438 | |
| 439 | NTLM is a Microsoft proprietary protocol. Unfortunately, curl does not |
| Daniel Stenberg | c59baa0 | 2001-02-12 10:05:09 +0000 | [diff] [blame^] | 440 | currently support that. Proprietary formats are evil. You should not use |
| 441 | such ones. |
| Daniel Stenberg | 2947010 | 2000-06-02 13:32:01 +0000 | [diff] [blame] | 442 | |
| Daniel Stenberg | c3318b4 | 2000-08-17 14:06:42 +0000 | [diff] [blame] | 443 | 5. libcurl Issues |
| Daniel Stenberg | 2947010 | 2000-06-02 13:32:01 +0000 | [diff] [blame] | 444 | |
| Daniel Stenberg | 7d09e51 | 2001-01-11 12:52:07 +0000 | [diff] [blame] | 445 | 5.1. Is libcurl thread-safe? |
| Daniel Stenberg | 2947010 | 2000-06-02 13:32:01 +0000 | [diff] [blame] | 446 | |
| Daniel Stenberg | 7d09e51 | 2001-01-11 12:52:07 +0000 | [diff] [blame] | 447 | Yes. |
| 448 | |
| 449 | We have written the libcurl code specificly adjusted for multi-threaded |
| 450 | programs. libcurl will use thread-safe functions instead of non-safe ones if |
| 451 | your system has such. |
| Daniel Stenberg | 2947010 | 2000-06-02 13:32:01 +0000 | [diff] [blame] | 452 | |
| Daniel Stenberg | e9640b6 | 2000-08-02 07:17:56 +0000 | [diff] [blame] | 453 | I am very interested in once and for all getting some kind of report or |
| 454 | README file from those who have used libcurl in a threaded environment, |
| 455 | since I haven't and I get this question more and more frequently! |
| Daniel Stenberg | 2947010 | 2000-06-02 13:32:01 +0000 | [diff] [blame] | 456 | |
| Daniel Stenberg | a40b55d | 2000-11-22 07:27:26 +0000 | [diff] [blame] | 457 | 5.2 How can I receive all data into a large memory chunk? |
| 458 | |
| 459 | You are in full control of the callback function that gets called every time |
| 460 | there is data received from the remote server. You can make that callback do |
| 461 | whatever you want. You do not have to write the receivied data to a file. |
| 462 | |
| 463 | One solution to this problem could be to have a pointer to a struct that you |
| 464 | pass to the callback function. You set the pointer using the |
| 465 | curl_easy_setopt(CURLOPT_FILE) function. Then that pointer will be passed to |
| 466 | the callback instead of a FILE * to a file: |
| 467 | |
| 468 | /* imaginary struct */ |
| 469 | struct MemoryStruct { |
| 470 | char *memory; |
| 471 | size_t size; |
| 472 | }; |
| 473 | |
| 474 | /* imaginary callback function */ |
| 475 | size_t |
| 476 | WriteMemoryCallback(void *ptr, size_t size, size_t nmemb, void *data) |
| 477 | { |
| 478 | register int realsize = size * nmemb; |
| 479 | struct MemoryStruct *mem = (struct MemoryStruct *)data; |
| 480 | |
| 481 | mem->memory = (char *)realloc(mem->memory, mem->size + realsize + 1); |
| 482 | if (mem->memory) { |
| 483 | memcpy(&(mem->memory[mem->size]), ptr, realsize); |
| 484 | mem->size += realsize; |
| 485 | mem->memory[mem->size] = 0; |
| 486 | } |
| 487 | return realsize; |
| 488 | } |
| 489 | |
| Daniel Stenberg | 2c10037 | 2000-12-19 07:30:51 +0000 | [diff] [blame] | 490 | 5.3 How do I fetch multiple files with libcurl? |
| Daniel Stenberg | ec5ac82 | 2000-12-14 08:37:09 +0000 | [diff] [blame] | 491 | |
| 492 | The easy interface of libcurl does not support multiple requests using the |
| 493 | same connection. The only available way to do multiple requests is to |
| 494 | init/perform/cleanup for each request. |
| Daniel Stenberg | a40b55d | 2000-11-22 07:27:26 +0000 | [diff] [blame] | 495 | |
| Daniel Stenberg | 910fc85 | 2000-12-30 11:48:51 +0000 | [diff] [blame] | 496 | 5.4 Does libcurl do Winsock initing on win32 systems? |
| 497 | |
| 498 | No. |
| 499 | |
| 500 | On win32 systems, you need to init the winsock stuff manually, libcurl will |
| 501 | not do that for you. WSAStartup() and WSACleanup() should be used |
| 502 | accordingly. The reason for this is of course that a single application may |
| 503 | use several different libraries and parts, and there's no reason for every |
| 504 | single library to do this. |
| 505 | |
| Daniel Stenberg | 5d7b32d | 2001-02-04 20:08:42 +0000 | [diff] [blame] | 506 | 5.5 Does CURLOPT_FILE and CURLOPT_INFILE work on win32 ? |
| Daniel Stenberg | 41084e5 | 2001-01-22 08:42:00 +0000 | [diff] [blame] | 507 | |
| 508 | Yes, but you cannot open a FILE * and pass the pointer to a DLL and have |
| Daniel Stenberg | 5d7b32d | 2001-02-04 20:08:42 +0000 | [diff] [blame] | 509 | that DLL use the FILE *. If you set CURLOPT_FILE you must also use |
| 510 | CURLOPT_WRITEFUNCTION as well to set a function that writes the file, even |
| 511 | if that simply writes the data to the specified FILE*. Similarly, if you use |
| 512 | CURLOPT_INFILE you must also specify CURLOPT_READFUNCTION. |
| Daniel Stenberg | 41084e5 | 2001-01-22 08:42:00 +0000 | [diff] [blame] | 513 | |
| Daniel Stenberg | 5d7b32d | 2001-02-04 20:08:42 +0000 | [diff] [blame] | 514 | (Provided by Joel DeYoung and Bob Schader) |
| Daniel Stenberg | 41084e5 | 2001-01-22 08:42:00 +0000 | [diff] [blame] | 515 | |
| Daniel Stenberg | 6dc5c6f | 2001-01-27 20:51:31 +0000 | [diff] [blame] | 516 | 5.6 What about Keep-Alive or persistant connections? |
| 517 | |
| 518 | This is closely related to issue 5.3. Since libcurl has no real support |
| 519 | for doing multiple file transfers, there's no support for Keep-Alive or |
| 520 | persistant connections either. |
| 521 | |
| 522 | This is of course subject to change as soon as libcurl gets support for |
| 523 | multiple files. Feel free to join in and make this change happen sooner! |
| 524 | |
| Daniel Stenberg | c3318b4 | 2000-08-17 14:06:42 +0000 | [diff] [blame] | 525 | 6. License Issues |
| Daniel Stenberg | c3c7739 | 2000-07-31 22:42:34 +0000 | [diff] [blame] | 526 | |
| Daniel Stenberg | c59baa0 | 2001-02-12 10:05:09 +0000 | [diff] [blame^] | 527 | NOTE: This section concerns curl 7.5.2 or later! |
| Daniel Stenberg | 0d181b5 | 2001-01-04 12:43:53 +0000 | [diff] [blame] | 528 | |
| 529 | Curl and libcurl are released under a MIT/X derivate license *or* the MPL, |
| 530 | the Mozilla Public License. To get a really good answer to your license |
| 531 | conflict questions, you should study the MPL and MIT/X licenses and the |
| 532 | license you are about to use and check for clashes yourself. This section is |
| 533 | just a brief summary for the cases we get the most questions. (Parts of this |
| 534 | section was much enhanced by Bjorn Reese.) |
| Daniel Stenberg | c3c7739 | 2000-07-31 22:42:34 +0000 | [diff] [blame] | 535 | |
| Daniel Stenberg | c3318b4 | 2000-08-17 14:06:42 +0000 | [diff] [blame] | 536 | 6.1. I have a GPL program, can I use the libcurl library? |
| Daniel Stenberg | c3c7739 | 2000-07-31 22:42:34 +0000 | [diff] [blame] | 537 | |
| Daniel Stenberg | 0d181b5 | 2001-01-04 12:43:53 +0000 | [diff] [blame] | 538 | Yes! |
| Daniel Stenberg | 7d1ef96 | 2000-08-14 06:31:59 +0000 | [diff] [blame] | 539 | |
| Daniel Stenberg | 0d181b5 | 2001-01-04 12:43:53 +0000 | [diff] [blame] | 540 | Since libcurl may be distributed under the MIT/X derivate license, it can be |
| 541 | used together with GPL in any software. |
| Daniel Stenberg | c3c7739 | 2000-07-31 22:42:34 +0000 | [diff] [blame] | 542 | |
| Daniel Stenberg | c3318b4 | 2000-08-17 14:06:42 +0000 | [diff] [blame] | 543 | 6.2. I have a closed-source program, can I use the libcurl library? |
| Daniel Stenberg | c3c7739 | 2000-07-31 22:42:34 +0000 | [diff] [blame] | 544 | |
| Daniel Stenberg | c59baa0 | 2001-02-12 10:05:09 +0000 | [diff] [blame^] | 545 | Yes! |
| Daniel Stenberg | 0d181b5 | 2001-01-04 12:43:53 +0000 | [diff] [blame] | 546 | |
| Daniel Stenberg | c59baa0 | 2001-02-12 10:05:09 +0000 | [diff] [blame^] | 547 | libcurl does not put any restrictions on the program that uses the library. |
| Daniel Stenberg | c3c7739 | 2000-07-31 22:42:34 +0000 | [diff] [blame] | 548 | |
| Daniel Stenberg | 31b8eea | 2000-08-23 07:27:00 +0000 | [diff] [blame] | 549 | 6.3. I have a BSD licensed program, can I use the libcurl library? |
| 550 | |
| Daniel Stenberg | c59baa0 | 2001-02-12 10:05:09 +0000 | [diff] [blame^] | 551 | Yes! |
| Daniel Stenberg | 0d181b5 | 2001-01-04 12:43:53 +0000 | [diff] [blame] | 552 | |
| Daniel Stenberg | c59baa0 | 2001-02-12 10:05:09 +0000 | [diff] [blame^] | 553 | libcurl does not put any restrictions on the program that uses the library. |
| Daniel Stenberg | 31b8eea | 2000-08-23 07:27:00 +0000 | [diff] [blame] | 554 | |
| 555 | 6.4. I have a program that uses LGPL libraries, can I use libcurl? |
| Daniel Stenberg | c3c7739 | 2000-07-31 22:42:34 +0000 | [diff] [blame] | 556 | |
| Daniel Stenberg | c59baa0 | 2001-02-12 10:05:09 +0000 | [diff] [blame^] | 557 | Yes! |
| Daniel Stenberg | c3c7739 | 2000-07-31 22:42:34 +0000 | [diff] [blame] | 558 | |
| Daniel Stenberg | c59baa0 | 2001-02-12 10:05:09 +0000 | [diff] [blame^] | 559 | The LGPL license doesn't clash with other licenses. |
| Daniel Stenberg | c3318b4 | 2000-08-17 14:06:42 +0000 | [diff] [blame] | 560 | |
| Daniel Stenberg | 31b8eea | 2000-08-23 07:27:00 +0000 | [diff] [blame] | 561 | 6.5. Can I modify curl/libcurl for my program and keep the changes secret? |
| Daniel Stenberg | c3c7739 | 2000-07-31 22:42:34 +0000 | [diff] [blame] | 562 | |
| Daniel Stenberg | c59baa0 | 2001-02-12 10:05:09 +0000 | [diff] [blame^] | 563 | Yes! |
| Daniel Stenberg | 0d181b5 | 2001-01-04 12:43:53 +0000 | [diff] [blame] | 564 | |
| 565 | The MIT/X derivate license practically allows you to do almost anything with |
| 566 | the sources, on the condition that the copyright texts in the sources are |
| 567 | left intact. |
| Daniel Stenberg | c3c7739 | 2000-07-31 22:42:34 +0000 | [diff] [blame] | 568 | |
| Daniel Stenberg | 31b8eea | 2000-08-23 07:27:00 +0000 | [diff] [blame] | 569 | 6.6. Can you please change the curl/libcurl license to XXXX? |
| Daniel Stenberg | c3c7739 | 2000-07-31 22:42:34 +0000 | [diff] [blame] | 570 | |
| Daniel Stenberg | c59baa0 | 2001-02-12 10:05:09 +0000 | [diff] [blame^] | 571 | No. |
| 572 | |
| 573 | We carefully picked this license years ago and a large amount of people have |
| 574 | contributed with source code knowing that this is the license we use. This |
| 575 | license puts the restrictions we want on curl/libcurl and it does not spread |
| 576 | to other programs or libraries that use it. The recent dual license |
| 577 | modification should make it possible for everyone to use libcurl or curl in |
| 578 | their projects, no matter what license they already have in use. |