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"