Linux system installation php extension cURL

  

Linux As a mature and stable operating system, it has many advantages. So most people learn Linux operating system. This article introduces the installation method of php extension cURL under Linux. I hope you can learn the installation of php extension cURL under Linux.

Method one

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 open the switch –with-curl=/usr/local/curl

.

This extension library is still very good and is a valid alternative to fsockopen and more.

Method 2

Enter the source directory of the original php,

cd ext cd curl phpize ./configure –with-curl=DIR make

The curl.so file will be generated under PHPDIR/ext/curl/moudles/.

Copy the curl.so file to the extensions configuration directory, modify php.ini just fine

The above two are the php extension cURL installation method under 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 directory when the source is installed with php)

sh# cd ./ext/curl

sh# phpize

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

When running ./configure, if prompted

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

Please 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 php extensions Under the directory)

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

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

Copyright © Windows knowledge All Rights Reserved