There exists a bunch of different error codes and their corresponding error messages that may appear during bad conditions. At the time of this writing, the exit codes are:
•1 - Unsupported protocol. This build of curl has no support for this protocol.
•2 - Failed to initialize.
•3 - URL malformat. The syntax was not correct.
À߸øµÈ Çü½ÄÀÇ µµ¸ÞÀÎ
•5 - Couldn't resolve proxy. The given proxy host could not be resolved.
•6 - Couldn't resolve host. The given remote host was not resolved.
ÇØ´ç µµ¸ÞÀÎÀ» ¸øã´Â´Ù´Â ¶æ
³×ÀÓ¼¹ö°¡ Á¦´ë·Î µî·ÏµÇ¾î ÀÖ´ÂÁö È®ÀÎÇÏ°í µµ¸ÞÀεµ Á¤È®ÇÑÁö È®ÀÎÇÒ °Í.
•7 - Failed to connect to host.
•8 - FTP weird server reply. The server sent data curl couldn't parse.
•9 - FTP access denied. The server denied login or denied access to the particular resource or directory you wanted to reach. Most often you tried to change to a directory that doesn't exist on the server.
•11 - FTP weird PASS reply. Curl couldn't parse the reply sent to the PASS request.
•13 - FTP weird PASV reply, Curl couldn't parse the reply sent to the PASV request.
•14 - FTP weird 227 format. Curl couldn't parse the 227-line the server sent.
•15 - FTP can't get host. Couldn't resolve the host IP we got in the 227-line.
•17 - FTP couldn't set binary. Couldn't change transfer method to binary.
•18 - Partial file. Only a part of the file was transferred.
•19 - FTP couldn't download/access the given file, the RETR (or similar) command failed.
•21 - FTP quote error. A quote command returned error from the server.
•22 - HTTP page not retrieved. The requested url was not found or returned another error with the HTTP error code being 400 or above. This return code only appears if -f/--fail is used.
•23 - Write error. Curl couldn't write data to a local filesystem or similar.
•25 - FTP couldn't STOR file. The server denied the STOR operation, used for FTP uploading.
•26 - Read error. Various reading problems.
•27 - Out of memory. A memory allocation request failed.
•28 - Operation timeout. The specified time-out period was reached according to the conditions.
•30 - FTP PORT failed. The PORT command failed. Not all FTP servers support the PORT command, try doing a transfer using PASV instead!
•31 - FTP couldn't use REST. The REST command failed. This command is used for resumed FTP transfers.
•33 - HTTP range error. The range "command" didn't work.
•34 - HTTP post error. Internal post-request generation error.
•35 - SSL connect error. The SSL handshaking failed.
•36 - FTP bad download resume. Couldn't continue an earlier aborted download.
•37 - FILE couldn't read file. Failed to open the file. Permissions?
•41 - Function not found. A required LDAP function was not found.
•42 - Aborted by callback. An application told curl to abort the operation.
•43 - Internal error. A function was called with a bad parameter.
•45 - Interface error. A specified outgoing interface could not be used.
•47 - Too many redirects. When following redirects, curl hit the maximum amount.
•48 - Unknown TELNET option specified.
•49 - Malformed telnet option.
•51 - The peer's SSL certificate or SSH MD5 fingerprint was not ok
¿¡·¯ ¸Þ½ÃÁö) SSL: certificate subject name 'www.test.co.kr' does not match target host name 'test.co.kr'
ÇØ°á1) ÀÎÁõ¼ ¹ß±Þ¹ÞÀº ÁּҷΠȣÃâÇϰųª
ÇØ°á2) ¼³Á¤À¸·Î Á¦¾î
TRUE to follow any "Location: " header that the server sends as part of the HTTP header (note this is recursive, PHP will follow as many "Location: " headers that it is sent, unless CURLOPT_MAXREDIRS is set).
FOLLOWLOCATION ¿É¼Ç ¼³Á¤. À§Ä¡ Çì´õ°¡ Á¸ÀçÇÏ¸é µû¶ó°£´Ù.
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, tru
CURLOPT_HEADER
TRUE to include the header in the output.
Çì´õ Á¤º¸¸¦ ¹Þ±â ¿øÇÑ´Ù¸é ÀÌ ¿É¼ÇÀ» Ãß°¡ÇÑ´Ù.
VALUE : 1 OR true
curl_setopt($ch, CURLOPT_HEADER, false);
CURLOPT_NOBODY
TRUE to exclude the body from the output.
º»¹®ÀÇ Á¤º¸¸¦ ¹Þ±â ¿øÇÏÁö ¾Ê´Â´Ù¸é ÀÌ ¿É¼ÇÀ» Ãß°¡ÇÑ´Ù.
CURLOPT_POST
TRUE to do a regular HTTP POST. This POST is the normal application/x-www-form-urlencoded kind, most commonly used by HTML forms.
Àü¼Û ¸Þ¼Òµå¸¦ ¼³Á¤ÇÑ´Ù.
VALUE : 1-POST, 0-GET
curl_setopt($ch, CURLOPT_POST,1);
CURLOPT_PORT
An alternative port number to connect to.
CURLOPT_SSLVERSION
The SSL version (2 or 3) to use. By default PHP will try to determine this itself, although in some cases this must be set manually.
SSL ¹öÁ¯ (https Á¢¼Ó½Ã¿¡ ÇÊ¿ä)
curl_setopt ($ch, CURLOPT_SSLVERSION,3);
CURLOPT_TIMEOUT
The maximum number of seconds to allow cURL functions to execute.
REQUEST ¿¡ ´ëÇÑ °á°ú°ªÀ» ¹Þ´Â ½Ã°£Å¸ÀÓ ¼³Á¤ÇÑ´Ù.
curl_setopt($ch, CURLOPT_TIMEOUT,100);
CURLOPT_POSTFIELDS
The full data to post in a HTTP "POST" operation. To post a file, prepend a filename with @ and use the full path.
POST ¸Þ¼Òµå¶ó¸é ÆĶó¹ÌÅÍ °ªµéÀ» ÀÌ ¿É¼Ç¿¡ Á¤ÀÇÇÏ¸é µÈ´Ù.
curl_setopt($cu, CURLOPT_POSTFIELDS,$vars); // º¸³¾ µ¥ÀÌŸ Çü½ÄÀº GET ¹æ½ÄÀ¸·Î ¼³Á¤
ex) $vars = "arg=$arg1&arg2=$arg2&arg3=$arg3";
CURLOPT_REFERER
The contents of the "Referer: " header to be used in a HTTP request.
¸®ÆÛ·¯ Á¤º¸¸¦ ¼³Á¤
CURLOPT_URL
The URL to fetch. This can also be set when initializing a session with curl_init().
Á¢¼ÓÇÒ urlÁ¤º¸¸¦ ¼³Á¤
curl_init()¿¡¼ url¸¦ ¼³Á¤ÇÏ¸é º°µµ ¼³Á¤ÀÌ ÇÊ¿ä¾ø´Ù.
curl_setopt($ch, CURLOPT_URL, 'http://www.exsample.com');
CURLOPT_USERAGENT
The contents of the "User-Agent: " header to be used in a HTTP request.
¿¡ÀÌÀüÆ® Á¤º¸¸¦ ¼³Á¤
curl_setopt($ch, CURLOPT_USERAGENT,"Mozilla/4.0 (compatible; MSIE 5.01; Windows NT 5.0)");