Installing cURL on Denwer. Installing curl in Debian How to find out if I have curl installed

A small program like curl can do a lot and is unlikely to be installed by default on your VPS server. If you are a web developer and don’t know what curl is, then you should familiarize yourself with its capabilities and, perhaps, some things that were previously difficult to do will now be implemented easier and more efficiently.

Those developers who have ever developed HTML - or XML - parsers know about its capabilities.

I discovered for myself curl only at the moment when it was necessary to develop a plugin for Textpattern, which, contrary to the policy of the social network VKontakte, would automatically add a notification about the publication of a new article to a public group. Unfortunately, I couldn’t do this without curl.

After we, I hope, have decided why we need this curl, we proceed to install it on the server where PHP and Apache are installed. If you have simple hosting (not VPS), then you should contact the hoster with a request to turn it on and he will do everything for you, if he has not already done so. This is exactly what happened to me on one hosting.

How do I know if I have curl installed?

Before rushing to installation, let's check: perhaps you already have it installed. I haven't found anything easier than creating a file, for example, curl.php with content:


and run it through the browser.

In the displayed sheet of text, you can search for curl on the page and if you don’t find it, then you can safely assume that you don’t have it installed.

Installing curl on Debian

Ever since the old days, when I used Ubuntu, I got used to DEB distributions and don’t want to change them. That is why on almost all my servers I use Debian as the operating system, which I have never regretted.

  1. We install everything you need:
    sudo apt-get install curl libcurl3 libcurl3-dev php5-curl php5-mcrypt
  2. After this, you just need to restart Apache:
    sudo /etc/init.d/apache2 restart

To confirm that curl has started working, we need to run our test file again - curl.php and go through the search for the last time on the open page. In 99% of cases, you will see confirmation that curl is already working and you can start enslaving the Internet.

P.S. Now is the time when it’s already cold outside, and our city administration is in no hurry to turn on the heating. At such moments, salvation can only be found in various heaters. A side effect of any heater is that it greatly dries the surrounding air. Home air humidifiers help combat this. It is these two devices that together will help survive this difficult time for Russia.

Is a free and open source data transfer tool used for transfer of data to and from a server using the following supported protocols: IMAP, IMAPS, POP, POP3, POP3S, DICT, FILE HTTP, HTTPS, SMB, SMBS, SMTP, SMTPS, FTP, FTPS, TELNET, RTSP, RMTP and TFTP.

During its normal operation, it displays a meter-like progress bar indicating parameters such as data transfer speed, amount of data transferred, and estimated time left. The speed is indicated in bytes per second. Let's see how we can install curl and php-curl in various Linux distributions.

Ubuntu 18.04, 17.10 and Debian 9.3

Login as root and update your Ubuntu system first

Apt-get update

Apt-get install curl

Install php-curl

Apt-get install php-curl

Apt-get install php5.6-curl

Apt-get install php5.5-curl

Verify curl is installed and check its version

From source

Visit curl's website and download the latest curl version by copying the link and using wget command

Uncompress the tarball file using the tar command below

CD curl-7.57.0

You"ll require the C compiler to build the source code. Install the C compiler as shown below.

Apt-get install build-essential

Run the commands below in succession to compile the source code

Centos 7

Login as root and run

Yum install curl

Installing php-curl

Yum install php-curl

From source

Just like we did in Ubuntu 17.10, navigate to curl"s website and download the curl tarball.

Wget https://curl.haxx.se/download/curl-7.57.0.tar.gz

Uncompress the tarball

Tax -xvf curl-7.57.0.tar.gz

Navigate to the uncompressed folder

CD curl-7.57.0

Centos 7 comes already installed with a C compiler. Run the commands below to compile the source code

./configure make make install

Verify installation of curl

Curl --verison

Fedora 27

NOTE Fedora 27 comes pre-installed with curl.

To install php-curl simply log in as root and run

Dnf -y install php-curl

Verify installation of curl

Curl --verison

Arch 2017 Linux

First, log in as root and update the system

Pacman-Sy

Pacman -S curl

Verify whether curl is installed

Pacman -Qi curl

Alpine Linux 3.7

Run apk add curl

Apk add curl

Verify installation of Curl

Apk search curl

Curl is the backbone of internet data transfer for thousands of software applications using a myriad of protocols. Being free and open source has enabled many contributors to work on the curl project and continually come up with newer and improved versions.

Jamie Arthur 3:17 am

About Jamie Arthur

James is a passionate Linux and Windows Systems Administrator with 4 years of experience in Linux, databases and Front-End development. He loves doing research on different Linux distributions and experimenting with installation and configuration of different services and features. His hobbies include swimming, reading novels and playing video games.

02/16/2006 Jeff Felling

Curl will help you manage data hosted on the Web. This article discusses the free Curl tool, which can be used to send and receive Web pages from the command line. Curl makes it easy to automate many

Curl will help you manage your data on the Web

This article looks at a free tool called Curl that lets you send and receive Web pages from the command line. Curl makes it easy to automate many security and administrative tasks, such as extracting a Web page for analysis or downloading a security patch from the Web.

Curl installation

Curl is included with many Unix distributions. Binaries and sources are available for most other operating systems. Even open source PHP programmers can use Curl to securely access Web content directly from PHP scripts.

Curl requires the OpenSSL package to work with Secure Sockets Layer (SSL) Web sites. There are two versions of Curl: one with SSL and one without SSL. I recommend the first one, since SSL reliably protects data.

Before you can use Curl with SSL functionality, you must download and separately install the OpenSSL package. OpenSSL for Windows binaries can be downloaded from the GnuWin32 SourceForge project site at . There are many other useful tools on this site that have been ported to Windows.

You should download and install the OpenSSL package, then copy the two DLL files to the system32 directory:

Copy "C:Program FilesGnuWin32 binlibeay32.dll" %windir%system32 copy "C:Program FilesGnuWin32 binlibssl32.dll" %windir%system32

After this you can install Curl. SSL-compatible Curl binaries for Windows can be found at http://curl.haxx.se/latest.cgi?curl=win32-ssl-sspi. The newest version, curl 7.15.0, is in win32-ssl-sspi.zip, which contains curl.exe and documentation.

After installing Curl, you should make sure it is working by entering the command

Curl http://isc.sans.org/infocon.txt

If a color word appears on the screen (for example, green), Curl is working. In this simple example, Curl retrieves Infocon content from the SANS Institute's Internet Storm Center Web site. Green means that the Internet is functioning normally and no serious threats have been detected. If instead of green the words yellow, orange or red appear on the screen, then put this article aside and visit the website http://isc.sans.org to learn about high-risk conditions on the Internet. If an error occurs, you must check that Curl is installed correctly.

Essentially, Curl fetches a Web page and then outputs the page's HTML source to the console. However, the utility's capabilities are wider. Curl has built-in error checking. For example, the command

Curl http://noserverhere

gives an error Curl: (6) Could not resolve host: noserverhere; Host not found. Error codes can be used in scripts to test the availability of a Web page or the responsiveness of the Web server. For example, if you use Curl to retrieve a Web page every day, specifically daily Web site statistics, you can augment the script with source code that looks for error codes. If Curl issues the error code Curl: (7) couldn't connect to host, you can immediately issue a warning or send an email.

Extracting encrypted data

One of the most important advantages of Curl is its SSL compatibility. Requested HTTPS pages are sent encrypted over the network, and Curl then displays the recovered text on the screen. Curl also checks certificates - the certificate's expiration date, whether the host name matches the host name in the certificate, and the trust level of the root certificate - and warns if the certificate is incorrect. The -cacert option allows you to specify a specific certificate file. Certificate checking is disabled using the -k option. An alternative approach is to use the -insecure option.

Not only for WWW

Curl's capabilities go beyond simply sending files over the Internet. Using Curl you can quickly list the directories of an FTP site:

Curl ftp://myftpsite

To see the site subdirectories, enter the command

Curl ftp://myftpsite/subdir/

To download a file from the Internet, simply specify the file name in the URL. The following example loads a file named readme.txt directly from the command line and displays it on the screen:

Curl ftp://ftp.microsoft.com/deskapps/games/readme.txt

It is often easier to prepare a script with Curl to input FTP files than to use the FTP command interactively.

By default, data is output directly to the console, but it can be redirected to a file using the -o and -O options. To get the page and save it to disk, you must specify the -o option. The -O option saves the resulting page in a local file, and Curl retrieves the name of the remote document. If the URL does not include a file name, this operation will fail. If you use Curl to send a request to a Web site without a file name, but want to store the result in a file, you can specify the file name on the command line, for example:

Authentication

Curl provides Basic, Digest and Integrated authentication methods. On most sites, form-based authentication pages can be accessed using Curl's submission functions, as will be demonstrated below. This means that you can send form data, such as your username and password, to a remote Web site that prompts you to enter information on its Web page. You can use the -u option to forward the credentials, or paste them into the URL, as is traditionally done in FTP, for example:

Curl ftp://username: password@myhtmlsite

Using Curl, techniques borrowed from FTP can be transferred to HTTP, as in the following example:

Curl http://username:password @myhtmlsite/default.htm

Curl also provides access to Web pages through a proxy server. Therefore, Curl can be configured to use a proxy server for authentication in Basic, Digest, and NTLM modes.

Read the documentation

In one article it is difficult to cover all the many functions of Curl, including uploading files to the server (-T), and viewing only the information in the HTTP header (-I), and viewing all data in detailed mode (-V), and hidden output ( -s). I recommend taking a more in-depth look at Curl's features in the tutorial posted at http://curl.haxx.se/docs .

Curl usage example

Now that we've learned the basics of Curl, let's look at a simple example of retrieving data from a Web site given some input. Let's build a simple Whois tool that demonstrates the simplicity and ease of use of Curl and the procedure for sending data to a Web site using the -d parameter. In this example, Curl sends the IP address to the Arin Whois Web site and then retrieves the results from that site. Whois looks up information about the owner of an IP address.

It's important to research the Web site before you begin, as each site's source code is different, and Curl doesn't always work the same on every site. A preliminary visit to the site allows you to collect the necessary information for Curl to work. In this example, I used a browser to visit a Web site http://www.arin.net/whois/, and noticed that the site has a single data entry field in which visitors indicate the IP address they are interested in. You need to get the details of this field, which is part of a Web form. This example uses the Perl script formfind.pl ( http://cool.haxx.se/cvs.cgi/curl/perl/contrib/ formfind?rev=HEAD&content-type=text/vnd.viewcvs-markup). The Formfind.pl script converts form data into useful output results and makes it easy to manually search for data in HTML. Of course, Perl must be deployed on your computer to run Formfind. A good Win32 Perl package can be ordered from the ActiveState ActivePerl website at http://www.activestate.com .

Let's look at the example in more detail. First, let's look at a Web site that contains a form that requests information:

Curl -o whoisOutputFile http://www.arin.net/whois/

This command retrieves the Whois page from http://www.arin.net and stores it in a text file whoisOutputFile, which contains the original HTML text that is rendered by the browser when the site is visited.

Then you need to find and select the form data:

./formfind.pl

Formfind provides form variables and their possible values. In this example, the output results are quite simple (see. screen 1).

Note the Input form data named queryinput. This is the text field that Curl should send the IP address you are looking for. The specific IP address does not matter - in this example the Microsoft address was used. Using the -d parameter, the searched IP address is forwarded to the queryinput field:

Curl -d "queryinput= 207.46.133.140" http://ws.arin.net/cgibin/whois.pl

The Curl command with the -d option looks up the data in the form, in this case queryinput, that represents the IP address being searched for. In this case, the target address changes; the form should submit data to a new URL that represents the whois.pl script. The new target address can be seen in the output of formfind in Screen 1.

This example also retrieves the original HTML text of the Whois response, but it is hidden by a group of HTML tags. By default, the Curl status message shows the document size, percentage complete, and forwarding speed. The output can be cleaned up a bit and filtered by the name of the organization that owns the IP address. Curl status can be disabled using the -s option. The command should be executed via grep to get only the OrgName:

Curl -s -d "queryinput= 207.46.133.140" http://ws.arin.net/cgibin/whois.pl | grep OrgName

In this example, the output shows that OrgName is Microsoft Corp.

@echo off curl -k -s -d "queryinput= %1" http://ws.arin.net/cgibin/whois.pl | grep OrgName



21 answers

You may already have a curl

You may not need to download anything:

  • If you're using Windows 10 version 1803 or higher, your OS comes with a copy of curl already configured and ready to use.
  • If you have more esoteric needs (e.g. you need cygwin builds, 3rd party builds, libcurl, header files, sources, etc.), use the curl download wizard. After answering five questions, you will be presented with a list of download links.

    Removing and adjusting curl

    Find curl.exe in your downloaded package; it's probably under bin\ .

    Select a location on your hard drive that will serve as a permanent home for the curls:

    • If you want to make curl its own folder, C:\Program Files\curl\ or C:\curl\ will do.
    • If you have a lot of free executables and don't want to add many separate folders to your PATH, use a single folder for this purpose, such as C:\Program Files\tools\ or C:\tools\ .

    Place curl.exe in the folder. And never move the folder or its contents.

    Then you'll want to make curl available anywhere on the command line. To do this, add the folder to PATH, like this:

    1. Click the Windows 10 Start menu. Start typing "environment."
    2. You will see the search result. Edit system environment variables. Choose this.
    3. The System Properties window opens. Click the button Environment Variables at the bottom.
    4. Select the "Path" variable in the "System Variables" section (bottom field). Click the button Change.
    5. Click " Add" and paste the path to the folder where curl.exe is located.
    6. Click OK, if it is needed. Close any open console windows and reopen them so they get the new PATH .

    Now enjoy typing curl on any command line. Time to have fun!

    To run curl from the command line

    a) Right click on the My Computer icon

    b) Select "Properties"

    d) Go to the [Advanced] tab - "Environment Variables" button

    e) Under "System Variable" select "Path" and "Edit"

    f) Add a semicolon and then the path to where you placed your curl.exe (eg D:\software\curl)

You can now run from the command line by typing:

Curl www.google.com

Starting with Windows 10 version 1803 (and earlier, Insider build 17063), you no longer install curl . Windows contains its own curl.exe (and tar.exe) in C:\Windows\System32\ which you can access directly from regular CMD.

C:\Users\vonc>C:\Windows\System32\curl.exe --version curl 7.55.1 (Windows) libcurl/7.55.1 WinSSL Release-Date: Protocols: dict file ftp ftps http https imap imaps pop3 pop3s smtp smtps telnet tftp Features: AsynchDNS IPv6 Largefile SSPI Kerberos SPNEGO NTLM SSL C:\Users\vonc>C:\Windows\System32\tar.exe --version bsdtar 3.3.2 - libarchive 3.3.2 zlib/1.2.5.f- ipp

It's probably worth noting that Powershell v3 and later contains the Invoke-WebRequest cmdlet, which has some curling capabilities. It's probably worth mentioning the New-WebServiceProxy and Invoke-RestMethod cmdlets as well.

I'm not sure if they will suit you or not, but even though I'm not Windows, I have to say that I find the object approach that PS uses much easier to work with utilities like curl, wget, etc. They might be worth a look

You can create the latest version of curl, openssl, libssh2 and zlib in 3 easy steps by following this tutorial.

Curl is built statically, so you don't have to propagate the necessary dynamic runtime.

You can also download the pre-built version (x86 and x64) from

I was looking for the download process Curl and every where they said copy the file curl.exe on System32, but they didn't provide a direct link. so you can enjoy here curl.exe easy to bin folder Just

unzip it and then go to the bin folder where you will get the exe file

I thought I would write exactly what I did (Windows 10, 64-bit version):

Select the curl executable.

Select Win64.

Choose universal.

Choose any one.

curl version: 7.53.1 - SSL enabled SSH enabled. Credit: Victor Shakats. This package is an executable type of curl. This link will get you a pre-compiled curl binary (or in some cases, using the information provided on the page that link takes you to). You may or may not install libcurl as a shared library/DLL. The file is packaged using 7zip. 7zip is a file archiving format.

Click download.

You should have curl-7.53.1-win64-mingw.7z file in your downloads folder.

Install 7-Zip if you don't have it.

Right click, 7-Zip, Extract here. Copy and paste the extracted file somewhere like Z:\Tools\

If you look in the bin folder you will see curl.exe. If you double click on it, the window will quickly flash and disappear. To run it, you need to use the command line. Go to your bin folder and enter curl followed by your options to make the request. You must use double quotes. Single quotes will not work with curl on Windows.

Now you need to add curl to the user Path variable so that you don't have to navigate to the correct folder to run the program. Go to This PC, Computer, System Properties, Advanced System Settings, log in as an administrator (you are not an administrator, right? Right?). Environment Variables, System Variables, look at the list and select Path, then Edit, then New, then e.g.

Z:\Tools\curl-7.53.1-win64-MinGW\Bin

You can add a backslash if you want, I don't think it matters. Press the move up button until it is at the top of the list and you can easily see it from the previous screen. Click OK, OK, OK, then open the command prompt and you can run curl by typing curl from any folder as any user. Don't forget your double quotes.

This is the answer I would like to receive.

This installer made it easy for me http://www.confusedbycode.com/curl/

"You can install cURL for Windows in just a few clicks. Simply download and run the installer from the table below and click Install. The default installation includes.