Downloads

PROTOCOLS

curl supports numerous protocols, or put in URL terms: schemes. Your particular build may not support them all.

DICT

Lets you lookup words using online dictionaries.

FILE

Read or write local files. curl does not support accessing file:// URL remotely, but when running on Microsft Windows using the native UNC approach will work.

FTP(S)

curl supports the File Transfer Protocol with a lot of tweaks and levers. With or without using TLS.

GOPHER

Retrieve files.

HTTP(S)

curl supports HTTP with numerous options and variations. It can speak HTTP version 0.9, 1.0, 1.1, 2 and 3 depending on build options and the correct command line options.

IMAP(S)

LDAP(S)

curl can do directory lookups for you, with or without TLS.

MQTT

curl supports MQTT version 3. Downloading over MQTT equals «subscribe» to a topic while uploading/posting equals «publish» on a topic. MQTT support is experimental and TLS based MQTT is not supported (yet).

POP3(S)

Downloading from a pop3 server means getting a mail. With or without using TLS.

RTMP(S)

The Realtime Messaging Protocol is primarily used to server streaming media and curl can download it.

RTSP

curl supports RTSP 1.0 downloads.

SCP

curl supports SSH version 2 scp transfers.

SFTP

curl supports SFTP (draft 5) done over SSH version 2.

SMB(S)

curl supports SMB version 1 for upload and download.

SMTP(S)

TELNET

Telling curl to fetch a telnet URL starts an interactive session where it sends what it reads on stdin and outputs what the server sends it.

TFTP

curl can do TFTP downloads and uploads.

Инструкция по ручному удалению вируса CURL.EXE

Для того, чтобы самостоятельно избавиться от CURL.EXE, вам необходимо последовательно выполнить все шаги, которые я привожу ниже:

  1. Поискать «CURL.EXE» в списке установленных программ и удалить ее.

Открыть Диспетчер задач и закрыть программы, у которых в описании или имени есть слова «CURL.EXE». Заметьте, из какой папки происходит запуск этой программы. Удалите эти папки.

Запретить вредные службы с помощью консоли services.msc.

Удалить “Назначенные задания”, относящиеся к CURL.EXE, с помощью консоли taskschd.msc.

С помощью редактора реестра regedit.exe поискать ключи с названием или содержащим «CURL.EXE» в реестре.

Проверить ярлыки для запуска браузеров на предмет наличия в конце командной строки дополнительных адресов Web сайтов и убедиться, что они указывают на подлинный браузер.

Проверить плагины всех установленных браузеров Internet Explorer, Chrome, Firefox и т.д.

Проверить настройки поиска, домашней страницы. При необходимости сбросить настройки в начальное положение.

Очистить корзину, временные файлы, кэш браузеров.

Proxy

curl supports both HTTP and SOCKS proxy servers, with optional authentication.
It does not have special support for FTP proxy servers since there are no
standards for those, but it can still be made to work with many of them. You
can also use both HTTP and SOCKS proxies to transfer files to and from FTP
servers.

Get an ftp file using an HTTP proxy named my-proxy that uses port 888:

Get a file from an HTTP server that requires user and password, using the
same proxy as above:

Some proxies require special authentication. Specify by using -U as above:

A comma-separated list of hosts and domains which do not use the proxy can be
specified as:

If the proxy is specified with instead of or , then
curl will use HTTP/1.0 instead of HTTP/1.1 for any attempts.

curl also supports SOCKS4 and SOCKS5 proxies with and .

See also the environment variables Curl supports that offer further proxy
control.

Most FTP proxy servers are set up to appear as a normal FTP server from the
client’s perspective, with special commands to select the remote FTP server.
curl supports the , and options that can be used to
set up transfers through many FTP proxies. For example, a file can be uploaded
to a remote FTP server using a Blue Coat FTP proxy with the options:

See the manual for your FTP proxy to determine the form it expects to set up
transfers, and curl’s option to see exactly what curl is sending.

Команда curl

Перед тем как перейти к описанию того как может использоваться команда curl linux, давайте разберем саму утилиту и ее основные опции, которые нам понадобятся. Синтаксис утилиты очень прост:

$ curl опции ссылка

Теперь рассмотрим основные опции:

  • -# — отображать простой прогресс-бар во время загрузки;
  • -0 — использовать протокол http 1.0;
  • -1 — использовать протокол шифрования tlsv1;
  • -2 — использовать sslv2;
  • -3 — использовать sslv3;
  • -4 — использовать ipv4;
  • -6 — использовать ipv6;
  • -A — указать свой USER_AGENT;
  • -b — сохранить Cookie в файл;
  • -c — отправить Cookie на сервер из файла;
  • -C — продолжить загрузку файла с места разрыва или указанного смещения;
  • -m — максимальное время ожидания ответа от сервера;
  • -d — отправить данные методом POST;
  • -D — сохранить заголовки, возвращенные сервером в файл;
  • -e — задать поле Referer-uri, указывает с какого сайта пришел пользователь;
  • -E — использовать внешний сертификат SSL;
  • -f — не выводить сообщения об ошибках;
  • -F — отправить данные в виде формы;
  • -G — если эта опция включена, то все данные, указанные в опции -d будут передаваться методом GET;
  • -H — передать заголовки на сервер;
  • -I — получать только HTTP заголовок, а все содержимое страницы игнорировать;
  • -j — прочитать и отправить cookie из файла;
  • -J — удалить заголовок из запроса;
  • -L — принимать и обрабатывать перенаправления;
  • -s — максимальное количество перенаправлений с помощью Location;
  • -o — выводить контент страницы в файл;
  • -O — сохранять контент в файл с именем страницы или файла на сервере;
  • -p — использовать прокси;
  • —proto — указать протокол, который нужно использовать;
  • -R —  сохранять время последнего изменения удаленного файла;
  • -s — выводить минимум информации об ошибках;
  • -S — выводить сообщения об ошибках;
  • -T — загрузить файл на сервер;
  • -v — максимально подробный вывод;
  • -y — минимальная скорость загрузки;
  • -Y — максимальная скорость загрузки;
  • -z — скачать файл, только если он был модифицирован позже указанного времени;
  • -V — вывести версию.

Это далеко не все параметры curl linux, но здесь перечислено все основное, что вам придется использовать.

DESCRIPTION

curl_easy_setopt is used to tell libcurl how to behave. By setting the appropriate options, the application can change libcurl’s behavior. All options are set with an option followed by a parameter. That parameter can be a long, a function pointer, an object pointer or a curl_off_t, depending on what the specific option expects. Read this manual carefully as bad input values may cause libcurl to behave badly! You can only set one option in each function call. A typical application uses many curl_easy_setopt calls in the setup phase.

Options set with this function call are valid for all forthcoming transfers performed using this handle. The options are not in any way reset between transfers, so if you want subsequent transfers with different options, you must change them between the transfers. You can optionally reset all options back to internal default with curl_easy_reset.

Strings passed to libcurl as ‘char *’ arguments, are copied by the library; thus the string storage associated to the pointer argument may be overwritten after curl_easy_setopt returns. The only exception to this rule is really CURLOPT_POSTFIELDS, but the alternative that copies the string CURLOPT_COPYPOSTFIELDS has some usage characteristics you need to read up on. This function does not accept input strings longer than CURL_MAX_INPUT_LENGTH (8 MB).

The order in which the options are set does not matter.

Before version 7.17.0, strings were not copied. Instead the user was forced keep them available until libcurl no longer needed them.

The handle is the return code from a curl_easy_init or curl_easy_duphandle call.

Persistent Connections

Specifying multiple files on a single command line will make curl transfer all
of them, one after the other in the specified order.

libcurl will attempt to use persistent connections for the transfers so that
the second transfer to the same host can use the same connection that was
already initiated and was left open in the previous transfer. This greatly
decreases connection time for all but the first transfer and it makes a far
better use of the network.

Note that curl cannot use persistent connections for transfers that are used
in subsequence curl invokes. Try to stuff as many URLs as possible on the same
command line if they are using the same host, as that’ll make the transfers
faster. If you use an HTTP proxy for file transfers, practically all transfers
will be persistent.

Downloads

You can install cURL for Windows with only a few clicks. Just download and run an installer from the table below, and click Install. The default installation includes:

  1. curl.exe
  2. an SSL certificate bundle (ca-cert-bundle.crt)
  3. SSL certificate bundle generation scripts (mk-ca-bundle.pl & mk-ca-bundle.vbs)
  4. HTML manuals for cURL and libcurl
  5. text documentation formatted for Windows (so you can simply double click the files to read them with Notepad)
  6. Start Menu folder with shortcuts to the cURL installation folder, manuals, documentation, and uninstaller
  7. cURL added to your path, so you can use it with batch or PowerShell scripts and call it from the command prompt in any working directory

To include developers’ files in your installation, click Advanced. The developers’ files include libcurl.dll, libeay32.dll, ssleay32.dll, libssh2.dll, zlib.dll, msvcr120.dll, C headers, libs, and code examples.

When you click Advanced you can also choose whether or not to install the documentation and manuals, and whether or not to add cURL to your path.

If you don’t have administrator privileges on your computer, use one of the files from the «Without Administrator Privileges» row. These install cURL in C:\Users\Name\AppData\Local\Apps.

If you do not want to use the installer, but still want the contents listed above, you can download one of the zip archives.

The Wizard Recommends…

For Win64 (CPU Independent) curl executable

curl version: 7.73.0 — SSL enabled SSH enabled
URL: https://curl.haxx.se/windows/
Provided by: the curl project

This package is type curl executable
You will get a pre-built ‘curl’ binary from this link (or in some cases, by
using the information that is provided at the page this link takes you). You
may or may not get ‘libcurl’ installed as a shared library/DLL.

The file is packaged using zip. Zip is a widely-used file archiving format. Wikipedia has more details on zip.

curl version: 7.73.0 — SSL enabled SSH enabled
URL: https://bintray.com/artifact/downlo…win64-mingw.zip
Provided by: Viktor Szakats

This package is type curl executable
You will get a pre-built ‘curl’ binary from this link (or in some cases, by
using the information that is provided at the page this link takes you). You
may or may not get ‘libcurl’ installed as a shared library/DLL.

The file is packaged using zip. Zip is a widely-used file archiving format. Wikipedia has more details on zip.

curl version: 7.73.0 — SSL enabled
URL: https://chocolatey.org/packages/curl
Provided by: Chocolatey

This package is type curl executable
You will get a pre-built ‘curl’ binary from this link (or in some cases, by
using the information that is provided at the page this link takes you). You
may or may not get ‘libcurl’ installed as a shared library/DLL.

The file is packaged using zip. Zip is a widely-used file archiving format. Wikipedia has more details on zip.

curl version: 7.73.0 — SSL enabled SSH enabled
URL: https://sslsites.de/paehl.com/open_…ce/?CURL_7.73.0
Provided by: Dirk Paehl

This package is type curl executable
You will get a pre-built ‘curl’ binary from this link (or in some cases, by
using the information that is provided at the page this link takes you). You
may or may not get ‘libcurl’ installed as a shared library/DLL.

The file is packaged using zip. Zip is a widely-used file archiving format. Wikipedia has more details on zip.

curl version: 7.64.1 — SSL enabled
URL: https://skanthak.homepage.t-online….curl-7.64.1.cab
Provided by: Stefan Kanthak

This package is type curl executable
You will get a pre-built ‘curl’ binary from this link (or in some cases, by
using the information that is provided at the page this link takes you). You
may or may not get ‘libcurl’ installed as a shared library/DLL.

This package is not built from the latest version available. This is
version 7.64.1 while the latest source available has version
7.73.0. This might be OK for you. If not, contact
the maintainer of this package (Stefan Kanthak) and ask kindly for an
update. Or get a ‘source’ package and build a newer one yourself.

The file is packaged using CAB.

We know only one OS version (unspecified) for package curl executable on Win64

We know only one CPU (CPU Independent/unknown) for package curl executable on Win64 version unspecified

Опции Править

Здесь перечислены только самые распространенные параметры, для получения полного списка см. статью curl_easy_setopt параметры.

CURLOPT_URL Править

Тип аргумента: char* строка с терминальным нулем

Определяет URL, с которым будет работать Libcurl. Это единственный параметр, который обязательно должен быть определен перед вызовом curl_easy_perform. Отправляемая в параметр строка должна быть закодирована, следуя.

CURLOPT_VERBOSE Править

Тип аргумента: long

Установите в параметр 1, чтобы позволить библиотеке подробно отображать информацию о ходе работы. Подробные сведения будут отправлены на STDERR, или в поток установленный параметром CURLOPT_STDERR.

Хотя этот параметр вряд ли пригодится в release версии вашего продукта, его можно эффективно использовать при отладке или составлении отчета об ошибке. Еще одна полезная опция для отладки — CURLOPT_DEBUGFUNCTION.

CURLOPT_WRITEFUNCTION Править

Тип аргумента: Указатель на функцию, которая должна соответствовать следующему прототипу: size_t function( void* ptr, size_t size, size_t nmemb, void* userdata);.

Эта функция вызывается в Libcurl, как только есть полученные данные, которые должны быть сохранены. Размер данных, на которую указывает аргумент ptr является size*nmemb. Получаемые данные не имеют терминальный ноль. Задаваемая функция должна возвращать количество обработанных байт. Если эта сумма будет отличаться от суммы, полученной на входе вашей функции, то будет отдан сигнал об ошибке в библиотеке. Это можно использовать для прервания передачи, с возвращемым значениемCURLE_WRITE_ERROR.

Функция может вернуть значение CURL_WRITEFUNC_PAUSE, которое приведет к приостановке записи в этом соединении. См. curl_easy_pause для более подробной информации.

Эта функция может быть вызвана с нулевым размером данных, если получаемые данные отсутствуют.

Установите этот параметр в NULL, чтобы определить встроенную функцию по умолчанию. Эта функция будет записывать данные в FILE* полученный из CURLOPT_WRITEDATA.

Установить значение в userdata можно параметром CURLOPT_WRITEDATA.

В функцию обратного вызова будет передаваться максимально возможное количество данных во всех вызовах, но это количество невозможно узнать заранее. Максимальный объем данных, который может быть передан в функцию записи, определен в заголовочном файле curl.h, как CURL_MAX_WRITE_SIZE.

CURLOPT_WRITEDATA Править

Тип аргумента: указатель void*, определяемый разработчиком, по умолчанию FILE*

Если вы используете параметр CURLOPT_WRITEFUNCTION, то этот указатель вы получите в качестве аргумента в callback функции. Встроенная функция в CURLOPT_WRITEFUNCTION будет записывать данные в поток FILE*, заданный этим параметром, или в stdout, если этот параметр не был установлен.

Если вы используете Libcurl в Win32 DLL, вы обязательно должны переопределить CURLOPT_WRITEFUNCTION, если вы используете этот параметр, иначе Libcurl будет некорректно работать.

Этот параметр также известен под старым названием CURLOPT_FILE.

Пошаговая инструкция по установке CURL на Windows 10

CURL — это инструмент командной строки и библиотека для передачи данных с URL-адресами. Это бесплатно, и многие приложения используют его. В этом посте мы расскажем, как установить CURL в Windows. Несколько удивительно, что он используется в автомобилях, телевизорах, роутерах, принтерах, аудиоаппаратуре, мобильных телефонах, планшетах, телевизионных приставках, медиаплеерах и во многих других местах.

Начиная с Windows 10 v 1803, ОС теперь поставляется с копией CURL. Он уже настроен, и вы можете сразу начать его использовать. Откройте командную строку и введите curl -help . Если ошибок нет и отображаются все параметры curl, он установлен на вашем Windows 10.

Наряду с Curl, Microsoft также выпустила Tar, инструмент командной строки для извлечения файлов и создания архивов.

Если по какой-то причине вы не можете найти CURL, установленный в вашей ОС Windows, вот как установить Curl в Windows.

1] Установите Git для Windows

Скачайте Git для Windows, и он установит CURL вместе с ним. Вы можете найти его установленным в C:\Program Files\Git\mingw64\bin\. Добавьте его в свой PATH Windows, и вы сможете выполнить его из любого места.

Нажмите кнопку запуска и введите system path. Появится опция для редактирования системных переменных. Нажмите на переменные среды, и вы сможете добавить путь, как указано выше, в системный путь.

2] Загрузите и установите Curl с исходного сайта.

Если Git не то, что вам нужно, вы можете установить CURL с исходного сайта. Перейдите сюда и загрузите соответствующий для вашей системы (32 или 64 бит). Если вы хотите загрузить определенные пакеты, посетите страницу пакетов curl. Здесь вы можете скачать исполняемый файл curl, разработку libcurl, libcurl или исходный код. Убедитесь, что добавили исполняемый файл к вашему пути.

3] CURL установщик

Если вы предпочитаете установку в один клик, используйте cURL для Windows. Вы можете скачать его здесь.

Все это установит CURL в Windows. Если вы что-то разрабатываете или для работы на вашем компьютере требуется CURL, вам это необходимо.

Как установить cURL на Windows?

для установки и настройки apache получить РНР5 пакеты и достань свертки.

я запускаю apache и запускаю PHP-скрипт. не проблема. но когда я запускаю PHP-скрипт с curl, это не удается.

возвращает: **Call to undefined function curl_version() in C:\Program Files\Apache Software Foundation\Apache2.2\htdocs\testing.php on line 5**

в которой строка 5 называется curl_init()

я вывожу php-i чтобы увидеть, вызывается ли правильный путь к расширению. Правильно установлено:

Я даже пытался запустить curl_version() но все же возникает такая же ошибка. Похоже, PHP не может найти расширение CURL, но php.ini (а также php-i) показывает, что он установлен.

причина, по которой мне нужно использовать CURL, заключается в том, что это требование из моего проекта. Так что я могу только придерживайся этого. Программе XAMPP. как это работает в Windows? Есть ли сайт, который вы можете порекомендовать? Спасибо.

Я пробовал много вещей по установке cURL и проверить все, но все же, я все еще кружусь вокруг проблемы и понятия не имею, что происходит.

сервер Apache использует правильный PHP.ini. и PHP.ini имеет правильный extension_dir и extension=php_curl.файл DLL Я понятия не имею, почему это не работает. даже я следую за каждым шагом для настройки вверх.

CONNECTION OPTIONS

CURLOPT_TIMEOUT

Timeout for the entire request. See CURLOPT_TIMEOUT

CURLOPT_TIMEOUT_MS

Millisecond timeout for the entire request. See CURLOPT_TIMEOUT_MS

CURLOPT_LOW_SPEED_LIMIT

Low speed limit to abort transfer. See CURLOPT_LOW_SPEED_LIMIT

CURLOPT_LOW_SPEED_TIME

Time to be below the speed to trigger low speed abort. See CURLOPT_LOW_SPEED_TIME

CURLOPT_MAX_SEND_SPEED_LARGE

Cap the upload speed to this. See CURLOPT_MAX_SEND_SPEED_LARGE

CURLOPT_MAX_RECV_SPEED_LARGE

Cap the download speed to this. See CURLOPT_MAX_RECV_SPEED_LARGE

CURLOPT_MAXCONNECTS

Maximum number of connections in the connection pool. See CURLOPT_MAXCONNECTS

CURLOPT_FRESH_CONNECT

Use a new connection. CURLOPT_FRESH_CONNECT

CURLOPT_FORBID_REUSE

Prevent subsequent connections from re-using this. See CURLOPT_FORBID_REUSE

CURLOPT_MAXAGE_CONN

Limit the age of connections for reuse. See CURLOPT_MAXAGE_CONN

CURLOPT_CONNECTTIMEOUT

Timeout for the connection phase. See CURLOPT_CONNECTTIMEOUT

CURLOPT_CONNECTTIMEOUT_MS

Millisecond timeout for the connection phase. See CURLOPT_CONNECTTIMEOUT_MS

CURLOPT_IPRESOLVE

IP version to resolve to. See CURLOPT_IPRESOLVE

CURLOPT_CONNECT_ONLY

Only connect, nothing else. See CURLOPT_CONNECT_ONLY

CURLOPT_USE_SSL

Use TLS/SSL. See CURLOPT_USE_SSL

CURLOPT_RESOLVE

Provide fixed/fake name resolves. See CURLOPT_RESOLVE

CURLOPT_DNS_INTERFACE

Bind name resolves to this interface. See CURLOPT_DNS_INTERFACE

CURLOPT_DNS_LOCAL_IP4

Bind name resolves to this IP4 address. See CURLOPT_DNS_LOCAL_IP4

CURLOPT_DNS_LOCAL_IP6

Bind name resolves to this IP6 address. See CURLOPT_DNS_LOCAL_IP6

CURLOPT_DNS_SERVERS

Preferred DNS servers. See CURLOPT_DNS_SERVERS

CURLOPT_DNS_SHUFFLE_ADDRESSES

Shuffle addresses before use. See CURLOPT_DNS_SHUFFLE_ADDRESSES

CURLOPT_ACCEPTTIMEOUT_MS

Timeout for waiting for the server’s connect back to be accepted. See CURLOPT_ACCEPTTIMEOUT_MS

CURLOPT_HAPPY_EYEBALLS_TIMEOUT_MS

Timeout for happy eyeballs. See CURLOPT_HAPPY_EYEBALLS_TIMEOUT_MS

CURLOPT_UPKEEP_INTERVAL_MS

Sets the interval at which connection upkeep are performed. See CURLOPT_UPKEEP_INTERVAL_MS

Получение информации

Ещё одним дополнительным шагом является получение данных о cURL запросе, после того, как он был выполнен.

// ...

curl_exec($ch);

$info = curl_getinfo($ch);

echo 'Took ' . $info . ' seconds for url ' . $info;

// …

Возвращаемый массив содержит следующую информацию:

  • “url”
  • “content_type”
  • “http_code”
  • “header_size”
  • “request_size”
  • “filetime”
  • “ssl_verify_result”
  • “redirect_count”
  • “total_time”
  • “namelookup_time”
  • “connect_time”
  • “pretransfer_time”
  • “size_upload”
  • “size_download”
  • “speed_download”
  • “speed_upload”
  • “download_content_length”
  • “upload_content_length”
  • “starttransfer_time”
  • “redirect_time”

The Wizard Recommends…

For Win32 (CPU Independent) curl executable

curl version: 7.73.0 — SSL enabled SSH enabled
URL: https://curl.haxx.se/windows/
Provided by: the curl project

This package is type curl executable
You will get a pre-built ‘curl’ binary from this link (or in some cases, by
using the information that is provided at the page this link takes you). You
may or may not get ‘libcurl’ installed as a shared library/DLL.

The file is packaged using zip. Zip is a widely-used file archiving format. Wikipedia has more details on zip.

curl version: 7.73.0 — SSL enabled
URL: https://chocolatey.org/packages/curl
Provided by: Chocolatey

This package is type curl executable
You will get a pre-built ‘curl’ binary from this link (or in some cases, by
using the information that is provided at the page this link takes you). You
may or may not get ‘libcurl’ installed as a shared library/DLL.

The file is packaged using zip. Zip is a widely-used file archiving format. Wikipedia has more details on zip.

curl version: 7.73.0 — SSL enabled SSH enabled
URL: https://bintray.com/artifact/downlo…win32-mingw.zip
Provided by: Viktor Szakats

This package is type curl executable
You will get a pre-built ‘curl’ binary from this link (or in some cases, by
using the information that is provided at the page this link takes you). You
may or may not get ‘libcurl’ installed as a shared library/DLL.

The file is packaged using zip. Zip is a widely-used file archiving format. Wikipedia has more details on zip.

curl version: 7.73.0 — SSL enabled SSH enabled
URL: https://sslsites.de/paehl.com/open_…ce/?CURL_7.73.0
Provided by: Dirk Paehl

This package is type curl executable
You will get a pre-built ‘curl’ binary from this link (or in some cases, by
using the information that is provided at the page this link takes you). You
may or may not get ‘libcurl’ installed as a shared library/DLL.

The file is packaged using zip. Zip is a widely-used file archiving format. Wikipedia has more details on zip.

curl version: 7.64.1 — SSL enabled
URL: https://skanthak.homepage.t-online….curl-7.64.1.cab
Provided by: Stefan Kanthak

This package is type curl executable
You will get a pre-built ‘curl’ binary from this link (or in some cases, by
using the information that is provided at the page this link takes you). You
may or may not get ‘libcurl’ installed as a shared library/DLL.

This package is not built from the latest version available. This is
version 7.64.1 while the latest source available has version
7.73.0. This might be OK for you. If not, contact
the maintainer of this package (Stefan Kanthak) and ask kindly for an
update. Or get a ‘source’ package and build a newer one yourself.

The file is packaged using CAB.

We know only one OS version (unspecified) for package curl executable on Win32

We know only one CPU (CPU Independent/unknown) for package curl executable on Win32 version unspecified

Добавить комментарий

Ваш адрес email не будет опубликован. Обязательные поля помечены *

Adblock
detector