Home>Article>Backend Development> Is curl built-in with PHP?

Is curl built-in with PHP?

(*-*)浩
(*-*)浩 Original
2019-10-14 16:00:44 2708browse

PHP-powered libcurl library created by Daniel Stenberg allows you to connect and communicate with a variety of servers using various types of protocols.

Is curl built-in with PHP?

libcurl currently supports http, https, ftp, gopher, telnet, dict, file and ldap protocols. libcurl also supports HTTPS authentication, HTTP POST, HTTP PUT, FTP upload (this can also be accomplished through PHP's FTP extension), HTTP form-based upload, proxy, cookies, and username and password authentication.

How to use cURL to implement Get and Post requests in PHP (recommended learning:PHP video tutorial)

These functions were introduced in PHP 4.0.2 .

Requirements

In order to use PHP's cURL function, you need to install the libcurl package.

PHP requires libcurl 7.0.2-beta or higher. To use cURL with PHP 4.2.3, you need to install libcurl version 7.9.0 or higher. Starting with PHP 4.3.0 you need to install libcurl version 7.9.0 or higher. Starting with PHP 5.0.0 you need to install version 7.10.5 or higher of libcurl.

Installation

To use PHP's cURL support you must add the --with-curl[=DIR] option when compiling PHP. DIR contains lib and include directory path. There must be a folder named curl that contains easy.h and curl.h in the include directory. There should be a file named libcurl.a in the lib folder. For PHP 4.3.0 you can configure --with-curlwrappers to make cURL use URL streams.

Note: Win32 users note that to use this module in a Windows environment, libeay32.dll and ssleay32.dll must be placed in the directory included in the PATH environment variable. Do not use libcurl.dll from the cURL website.

Resource type

This extension defines 2 resources: cURL handle and cURL batch handle.

For example, let’s take Baidu, the famous “test network connection” website, as an example to try curl

The above is the detailed content of Is curl built-in with PHP?. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Previous article:Is php cross-platform? Next article:Is php cross-platform?