Installing the PHP Extension curl

Source: Internet
Author: User

System: CentOS 6.8 64

Environment: PHP 5.6.9

There are two cases of installing curl:

First: Install the Curl Extension before PHP is installed

Installation process:

1. Download Curl

wget https://curl.haxx.se/download/curl-7.54.1.tar.gz

2. Decompression and Installation

TAR-ZXF curl-7.54.1.tar.gz

./configure--prefix=/usr/local/curl (mounting position)

Make & make Install

When installing PHP, install it on the./configure--with-curl=/usr/local/curl.

Second: Install the Curl extension when you install PHP

1, download the source code PHP source package, download and their own server equivalent to the large version can be, for example: PHP version of the server is PHP 5.6.9, I downloaded PHP 5.6.30 is also possible

2. Enter CD Php-5.6.30/ext/curl

3. Call the Phpize program to generate the compilation configuration file

/usr/local/php56/bin/phpize (phpize call mainly see PHP installation location)

4. Call configure to generate the makefile file, then call make compile, make install.

./configure-with-curl=/usr/local/curl-with-php-config=/usr/local/php56/bin/php-config

Note Configure process has no error, if there are errors are the system lacks the necessary software, installation can be

Make&&make Install

After completion, there will be path generation.

/usr/local/php5/lib/php/extensions/no-debug-non-zts-20060613/

You can view the CD to the path to see if the curl.so exists.

5. Modify the PHP configuration file

Vim php.ini

Add Last: Extension = curl.so
6, restart PHP-FPM can.


This article from "Hisus" blog, declined reprint!

Installing the PHP Extension curl

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.