Install php extension cURL in Linux

Source: Internet
Author: User
Welcome to the Linux community forum and interact with 2 million technical staff to enter Linux as a mature and stable operating system, which has many advantages. So most people learn about the Linux operating system. This article describes how to install php extension cURL in Linux. I hope you can learn how to install php extension cURL in Linux. Method 1 install c

Welcome to the Linux community forum and interact with 2 million technicians> as a mature and stable operating system, Linux has many advantages. So most people learn about the Linux operating system. This article describes how to install php extension cURL in Linux. I hope you can learn how to install php extension cURL in Linux. Method 1 install c

Welcome to the Linux community forum and interact with 2 million technicians>

As a mature and stable operating system, Linux has many advantages. So most people learn about the Linux operating system. This article describes how to install php extension cURL in Linux. I hope you can learn how to install php extension cURL in Linux.

Method 1

Install cURL

# Wget http://curl.haxx.se/download/curl-7.17.1.tar.gz [url = http://curl.haxx.se/download/curl-7.15.0.tar.gz?#/url] # tar-zxf curl-7.17.1.tar.gz #./configure? Prefix =/usr/local/curl # make; make install

Install php

Just turn on the switch? With-curl =/usr/local/curl

You can.

This extended library is a great alternative to fsockopen and so on.

Method 2

Go to the source code directory for installing the original php,

Cd ext cd curl phpize./configure? With-curl = DIR make

The curl. so file is generated under PHPDIR/ext/curl/moudles.

Copy the curl. so file to the configuration directory of extensions and modify php. ini.

The above two methods are used to install php extension cURL in Linux.

Sh # wget http://curl.haxx.se/download/curl-7.18.2.tar.gz

Sh # tar-zxvf curl-7 *. gz

Sh # cd curl *

Sh #./configure -- prefix =/usr/local/curl

Sh # make

Sh # make install sh # cd/usr/local/src/php-5.2.1 (this is the source code directory when installing php)

Sh # cd./ext/curl

Sh # phpize

Sh #./configure -- with-curl =/usr/local/curl

If you are prompted to run./configure

Configure: error: Cannot find php-config. Please use -- with-php-config = PATH

Use:

./Configure -- with-php-config =/php-install-path/bin/php-config # instead of using php. ini

Sh # make

Sh # cp modules/curl. so/usr/local/lib/php/extensions (copy modules/curl. so to the php extension directory)

(Modify the php. ini file and add: extension = curl. so)

Sh # apachectl-k restart (restart apache, php should have curl extension) php. ini modification method, according to your actual curl. so file location to write, compare my compiled location:/usr/local/php/lib/php/extensions/no-debug-zts-20060613/so php. ini plus extension = "/usr/local/php/lib/php/extensions/no-debug-zts-20060613/curl. so"

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.