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